title: useLazyQuery results into "Too many re-renders"
body: <p>I am trying to <a href="https://www.apollographql.com/docs/react/data/queries/#executing-queries-manually" rel="nofollow noreferrer">Execute queries manually</a> and followed, therefore, the official Apollo documentation. I don't see any difference between the documentation and my code, however, I always get the error "Too many re-renders."</p>
  
  <pre><code>const FEED_QUERY = gql`
    query contactAccessKey($accessKey: String!) {
      contactAccessKey(accessKey: $accessKey) {
        id
        contactInformation
        belongsTo {
          id
          username
          email
        }
      }
    }
  `;
  
  function AccessKeySeeEmergencyContact() {
    const [contact, setContact] = useState("");
    const [getContactInformation, { loading, data }] = useLazyQuery(FEED_QUERY);
  
    if (loading) return &lt;p&gt;Loading ...&lt;/p&gt;;
  
    if (data &amp;&amp; data.contactAccessKey) {
      setContact(data.contactAccessKey);
    }
  
    const accessKeyCode = "34a60667-80e3-4c97-9ded-15875d6507b1";
  
    return (
      &lt;div&gt;
        {contact &amp;&amp; &lt;div&gt;{contact.contactInformation}&lt;/div&gt;}
        &lt;button
          onClick={() =&gt;
            getContactInformation({ variables: { accessKey: accessKeyCode } })
          }
        &gt;
          Click me!
        &lt;/button&gt;
      &lt;/div&gt;
    );
  }
  
  export default AccessKeySeeEmergencyContact;
  </code></pre>