title: Apollo Cache - Missing selection set for object of type undefined returned for query field names
body: <p>I am building an app with apollo-boost, which should include already some of the packages to do a react app with graphql.</p>
  
  <p>I am facing an error at the moment I want to store pieces of data into my Apollo cache.</p>
  
  <p>ApolloClient.tsx</p>
  
  <pre><code>import ApolloClient from 'apollo-boost'
  import { InMemoryCache } from 'apollo-cache-inmemory'
  
  import { secretToken } from './secretToken'
  
  const cache = new InMemoryCache({
  })
  
  const client = new ApolloClient({
    uri: 'https://someUrlIremovedForTheQuestion.com',
    request: async operation =&gt; {
      operation.setContext({
        headers: {
          Authorization: secretToken
        }
      })
    },
    cache
  })
  
  client.writeData({
    data: {
      names: [
        {
          firstName: 'Mario'
        },
        {
          firstName: 'Luigi'
        }
      ]
    }
  })
  export default client
  </code></pre>
  
  <p>Now I am trying to access to these names I created here in the same apollo config:</p>
  
  <p>MyComponent.tsx</p>
  
  <pre><code>const result = client.readQuery({ query: gql`
        query namesCached {
          names @client
        }`
      })
  console.log(result)
  </code></pre>
  
  <p>this is always falling into this error: </p>
  
  <p><code>Missing selection set for object of type undefined returned for query field names</code></p>
  
  <p>If I am doing a single piece of data, like <code>name: 'Mario'</code>, that works perfect and retrieve that piece of data, but for deeper objects or arrays it always fails with this error.</p>
  
  <p>I am using Typescript as well</p>
  
  <p>Any idea what could be? Stack overflow is shown me a couple non-working answers and GitHub is not providing me the solution either...</p>
  
  <p><strong>Edit</strong>
  So here it comes my real example to make it more close to my real issue: </p>
  
  <pre><code>&lt;Query
      query={fetchdata}
      onCompleted={({ repository }) =&gt; client.writeData({
          data: {
            issues: repository.issues.edges
          }
        })
      }
    &gt;
  </code></pre>
  
  <p>Basically I am doing a Query, and once is completed I want to store it in cache, since I am checking it multiple times to compare and filter some results.</p>
  
  <p>I tried just with <code>repository</code> but still in the same error</p>
  
  <p>To retrieve the data i am doing the same as above but with <code>issues</code> instead of <code>names</code></p>