title: GraphQL mutation: Invariant Violation: Must contain a query definition
body: <p>I am trying to make a <strong><code>mutation</code></strong> call to my graphQL server from a react application. The react code looks like the following:</p>
  <pre><code>client.query({
    query: gql`
      mutation{
          addTeam(input:{name:&quot;Somename&quot;, label:&quot;somelabel&quot;})
          {error, status}
      }`
   }).then((resp: any) =&gt; {
        console.log(&quot;Success&quot;, resp);
   }).catch(err =&gt; {
        throw err;
   })
  </code></pre>
  <p>And I am getting the following error:</p>
  <p><a href="https://i.stack.imgur.com/S4705.png" rel="noreferrer"><img src="https://i.stack.imgur.com/S4705.png" alt="enter image description here" /></a></p>
  <p>But if I change the same request, from <code>mutation</code> to <code>query</code>, and make the necessary changes in my node-graphQL-server to handle it as <code>query</code> instead of <code>mutation</code> the same code works.</p>
  <h2>Apollo-Client <code>Mutation</code> <a href="https://www.apollographql.com/docs/react/basics/mutations.html" rel="noreferrer">docs says</a></h2>
  <blockquote>
  <p>In GraphQL, mutations are identical to queries in syntax, the only difference being that you use the keyword <code>mutation</code> instead of <code>query</code>...</p>
  </blockquote>
  <p>Oh and BTW, the same <code>mutation</code> query WORKS in <strong><code>Playground</code></strong>.
  Please help guys, my work is kinda stopped coz of this issue.</p>
  <p>Thanks!</p>