My mutation query:
mutation ($matchId: String!) {
assignMatch(matchId: $matchId) {
id
}
}
Query variables:
{ "matchId": "123" }
GraphQL schema (Mutation definition):
type Mutation {
assignMatch(matchId: String!): Assignment
}
GraphQL server is written in Java. But I am pretty sure that the request is not event reaching it and fails on the GraphQL layer. Anyway, schema definition is pretty simple: GraphQL graphQL = GraphQL.newGraphQL(SchemaParser.newParser().file("schema.graphqls").build().makeExecutableSchema())
Result: Error with message Variable 'matchId' has coerced Null value for NonNull type 'String!
Please note that mutation assignMatch(matchId: "123")
succeeds.
Am I defining a query variable in a wrong way? Or why is not picked up by GraphiQL?
I tried using both GraphiQL interface and apollo-client to send the request with variables, but have the same error. Any ideas?