Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github graphql api, what does "clientMutationId" mean?

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?

like image 649
slideshowp2 Avatar asked Jul 12 '18 10:07

slideshowp2


People also ask

Why does GitHub use GraphQL?

GitHub chose GraphQL because it offers significantly more flexibility for our integrators. The ability to define precisely the data you want—and only the data you want—is a powerful advantage over traditional REST API endpoints.


Video Answer


1 Answers

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.

like image 92
Marco Daniel Avatar answered Oct 11 '22 05:10

Marco Daniel