Solved

What is "clientMutationId" used for?

  • 4 November 2021
  • 3 replies
  • 1274 views

Userlevel 4

I see that “clientMutationId” is always needed as part of the GraphQL payload. But What is this for??

In the result from GraphQL always come back as NULL. In the Dev Docs says “A unique identifier for the client performing the mutation.” Can I register a Client for the miutation?

 

Thanks!

icon

Best answer by Roberto Chavarria 16 February 2022, 22:57

View original

This topic has been closed for comments

3 replies

Userlevel 3

Hello Ramón!

Cliet Mutation Id is not required to run a mutation. That’s why when you don’t specify it, the result will return ‘null’:
 

However, if you name your mutation by specifying a ‘clientMutationId’ of your choice, it can be better for you to diferentiate the mutations you run, making for a better organization and reading in your technical logs:
 

 

Userlevel 4

Hello Reicado.. So any string I put in this field will be reflected as the name of the “person” making the mutation?

Userlevel 6
Badge +5

Hey Ramon! You can think of this as more of an identifier in case you need to debug which of the queries went wrong. Together with whatever language you prefer to script in, you can make it dynamic and you’ll have improved your logs;