title: Why I got error: Cannot query field xx on type "Query"?
body: <p>Although I copied and pasted the graphQL query from the GraphiQL tool after I tested it at GraphiQL successfully , the query returned with an error when I tried it in Apollo client within a reactJS app:</p>
  
  <pre><code>[GraphQL error]: Message: Cannot query field "allStudents" on type "Query"., Location: [object Object], Path: undefined
  </code></pre>
  
  <p>Here is my implementation:</p>
  
  <pre><code>const link = createHttpLink({
    uri: 'http://localhost:8000/graphql',
    fetchOptions: { method: "POST" }
  });
  
  const client = new ApolloClient({
    link: link 
  });
  
  const GET_STUDENTS = gql`
  query getStudents($schoolID: Int!){
    allStudents(schoolId: $schoolID){
      pickUpLat
      pickUpLng
    }
  }
  `;
  
  client
    .query({
      query: GET_STUDENTS,
      variables: { schoolID: 1 }
    })
    .then(result =&gt; console.log(result));
  </code></pre>
  
  <p>What could be wrong? here is the correct response that I expected:</p>
  
  <pre><code>{
    "data": {
      "allStudents": [
        {
          "pickUpLat": 31.9752942479727,
          "pickUpLng": 35.8438429235775
        },
        {
          "pickUpLat": 31.9754545979993,
          "pickUpLng": 35.8437478537235
        }
      ]
    }
  }
  </code></pre>
  
  <p><strong>EDIT</strong>
  I get expected results using GraphiQL:
  <a href="https://i.stack.imgur.com/Gv9Ig.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Gv9Ig.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT2</strong></p>
  
  <p>I tried to compare the payload between my request and GraphiQL request:</p>
  
  <p>My request's payload: ( it has <code>__typename</code> which I don't know why )</p>
  
  <pre><code>{"operationName":"getStudents","variables":{"schoolID":1},"query":"query getStudents($schoolID: Int) {\n  allStudents(schoolId: $schoolID) {\n    pickUpLat\n    pickUpLng\n    __typename\n  }\n}\n"}
  </code></pre>
  
  <p>GraphiQL request's payload:</p>
  
  <pre><code>{"query":"query getStudents($schoolID: Int!){\n  allStudents(schoolId: $schoolID){\n    pickUpLat\n    pickUpLng\n  }\n}","variables":{"schoolID":1},"operationName":"getStudents"}
  </code></pre>
  
  <p>So, they are almost identical, Any idea?</p>