github graphql api, what does "clientMutationId" mean?
Asked Answered
V

1

23

I saw clientMutationId field in example-strong-typing documentation.

mutation {
  addComment(input:{clientMutationId: 1234, subjectId: "MDA6SXNzdWUyMjcyMDA2MTT=", body: "Looks good to me!"}) {
    clientMutationId
    commentEdge {
      node {
        body
        repository {
          id
          name
          nameWithOwner
        }
        issue {
          number
        }
      }
    }
  }
}

what does clientMutationId mean? How can I generate it?

Viscosity answered 12/7, 2018 at 10:40 Comment(0)
A
24

clientMutationId is not directly related with GraphQL but it is with graphql-relay.

Check Understanding Relay Mutations for a better explanation.

clientMutationId. This ID is generated by the Relay client behind the scenes to track the mutation's progress.

Assembled answered 16/7, 2018 at 13:31 Comment(1)
Also note, it's optional. Personally wasn't sure if it was required at first.Pretension

© 2022 - 2024 — McMap. All rights reserved.