Miguel Oller
Miguel Oller

Reputation: 117

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?

Upvotes: 0

Views: 226

Answers (1)

Ahmad Ferdous
Ahmad Ferdous

Reputation: 3399

"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.

Upvotes: 1

Related Questions