4

In the relay documentation here, it says that:

Relay uses a common pattern for mutations, where there are root fields on the mutation type with a single argument, input, and where the input and output both contain a client mutation identifier used to reconcile requests and responses.

But in the example they provided, the input and output looked like this respectively:

// IntroducedShipInput
{
  "input": {
    "shipName": "B-Wing",
    "factionId": "1"
  }
}

// IntroducedShipPayload
{
  "introduceShip": {
    "ship": {
      "id": "U2hpcDo5",
      "name": "B-Wing"
    },
    "faction": {
      "name": "Alliance to Restore the Republic"
    }
  }
}

So what is the client mutation identifier? And why, and how does it get used to reconcile requests and responses?

davidx1
  • 2,878
  • 6
  • 31
  • 54

1 Answers1

1

I'm still not 100% sure what exactly happened to the "client mutation identifier," but having done some research, it appears to have been a requirement in previous versions of Relay. This PR apparently removed the requirement by replacing it with some other mechanism, but it's not clear to me what that other mechanism does. I left a comment requesting more clarification around the documentation, which appears to be out of date.

At any rate, the client mutation identifier appears to have been related to some assumptions about mutation idempotency in Facebook's implementation of GraphQL.

Ersin Akinci
  • 104
  • 1
  • 5