title: Apollo useQuery hook on component mount
body: <p>I'm new to hooks and trying to use them more</p>
  <p>How can I get data (with Apollo) when a component mount ?</p>
  <p>I'm trying to use useQuery inside a useEffect, my code so far looks like this</p>
  <pre><code>const MyComponent = () =&gt; {
    const getME = () =&gt; {
        const { loading, error, data } = useQuery(ME);
        setMe(data.me) // useState hook
        console.log('query me: ', me);
    };
  
    useEffect(getME);
    return (&lt;&gt;
    ...
    &lt;/&gt;)
  }
  </code></pre>
  <p>but this gives me an error</p>
  <pre><code>Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
  </code></pre>
  <p>edit: this is the query</p>
  <pre><code>import { gql } from '@apollo/client';
  
  export const ME = gql`
    query me {
      profile {
        firstName
        lastName
      }
    }
  `;
  </code></pre>