This is what i am using in my intergration tests:
GraphQlTester.Response response = gqlTester
.document("""
mutation updateSomething($id: ID!, $something: String!) {
updateName(
id: $id,
field: $something
){
id
a
b
}
}
""")
.operationName("updateSomething")
.variable("id", theId)
.variable("something", "Something")
.execute();
From what I understand, operation names are mandatory for multi-operation documents and can be used for logging in the backend.
a) How do I implement a multi-operation document in the GraphQlTester?
b) How do I use the operation name for logging in my spring-boot backend?
My resolver in the backend looks like this:
@MutationMapping
public ReturnValue updateName(@Argument String id, @Argument String something) {
return myService.updateSomething(id, something);
}