title: How to run graphql query in a loop until condition is not matched
body: <p>I am trying to run a graphql query to retrieve all products from shopify graphql api, but we can not query all data at once due to limited rate limit. So how can I query all data without facing the rate limit problem and effectively?
  Any help would be greatly appreciated</p>
  <pre class="lang-js prettyprint-override"><code>const myproducts = await axios({
          url: `https://${req.session.shop}/admin/api/2022-01/graphql.json`,
          method: 'post',
          headers: {
            &quot;X-Shopify-Access-Token&quot;: req.session.token,
          },
          data: {
              query: `
              query ($numProducts: Int!) {
                products(first: $numProducts) {
                  edges {
                    cursor
                    node {
                      id
                      title
                      
                    }
                  }
                  pageInfo {
                    hasNextPage
                    
                  }
                }
              }
              `,
              variables: {
                numProducts: 3
                
              }
          },
  
  
      });
  </code></pre>