title: How to pass parameters/variables to query or mutation?
body: <p>I'm trying to read some parameters passed down through variables on my backend, lets see:
  (this method is inside <code>AuthenticationService</code>, injected in my graphql controller, see bellow)</p>
  
  <pre><code>@GraphQLMutation(name = "getSessionToken")
  public AuthReturn getSessionToken(@GraphQLArgument(name = "user") String u, @GraphQLArgument(name = "password") String p) {...}
  </code></pre>
  
  <p>And here is my graphQL request:</p>
  
  <pre><code>mutation ($user: String!, $password: String!) {
    getSessionToken(user: $user, password: $password) {
      status
      payload
    }
  }
  </code></pre>
  
  <p>and my variables:</p>
  
  <pre><code>{ "user": "myuser", "password": "mypass"}
  </code></pre>
  
  <p>but when I try to run this sample codes, the following error is showed:</p>
  
  <pre><code>{"timestamp":"2019-07-29T17:18:32.753+0000","status":400,"error":"Bad Request","message":"JSON parse error: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token\n at [Source: (PushbackInputStream); line: 1, column: 162] (through reference chain: java.util.LinkedHashMap[\"variables\"])","path":"/graphql"}
  </code></pre>
  
  <p>[Edit]
  And here is my Controller:</p>
  
  <pre><code>@RestController
  public class GraphQLController {
  
      private final GraphQL graphQL;
  
      public GraphQLController(AgendamentoService agendamentos, ConfiguracaoService config, ProcessoService processos, ParametroService parametros, AuthenticationService autenticacao) {
          GraphQLSchema schema = new GraphQLSchemaGenerator()
                  .withResolverBuilders(
                          //Resolve by annotations
                          new AnnotatedResolverBuilder())
                  .withOperationsFromSingletons(agendamentos, config, processos, parametros, autenticacao)
                  .withValueMapperFactory(new JacksonValueMapperFactory())
                  .generate();
          graphQL = GraphQL.newGraphQL(schema).build();
      }
  
      @CrossOrigin
      @PostMapping(value = "/graphql", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
      @ResponseBody
      public Map&lt;String, Object&gt; graphql(@RequestBody Map&lt;String, String&gt; request, HttpServletRequest raw) {
          // em context estamos passando o Request, usamos para fazer as verificacoes de autenticacao com GraphQl 
          ExecutionResult executionResult = graphQL.execute(ExecutionInput.newExecutionInput()
                  .query(request.get("query"))
                  .operationName(request.get("operationName"))
                  .context(raw)
                  .build());
          return executionResult.toSpecification();
      }
  }
  </code></pre>
  
  <p>but if I run this mutation without passing parameters as <code>variables</code> on request, every thing works properly. What can I do to pass variables to my graphQl requests? Thanks in advance.</p>