简体   繁体   中英

Why does Relay need a mutation id to reconcile GraphQL mutations?

I've tried to figure out why, but always end up concluding that the "tracking" could be easily done within the closure of the request that was sent. I'm clearly missing something here.

Why does Relay need a mutation ID to track the request/response?

"tracking" could be easily done within the closure of the request that was sent

You're thinking in terms of implementation. Relay is a JavaScript framework that implements the Relay specification. Under the specification, it is not a good idea to rely on something (closure) that a language may or may not support. Therefore, Relay Input Object Mutations Specification specifies clientMutationId to track the mutation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM