Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
Cómo enviar todos los valores hasta el último valor en un ciclo while

En esto, send el último valor de la consulta hasta que sea falso, quiero que envíe todos los valores anteriores y el valor actual juntos, envíe todos los valores hasta hasNextPage es falso

 while(hasNextPage == true){ myproducts = await axios({ url: `https://${req.session.shop}/admin/api/2022-01/graphql.json`, method: 'post', headers: { "X-Shopify-Access-Token": req.session.token, }, data: { query: ` query($numProducts: Int!, $cursor: String) { products(first: $numProducts, after: $cursor) { edges { cursor node { id title } } pageInfo { hasNextPage } } } `, variables: { numProducts: 2, cursor: productCursor } }, }); productCursor = myproducts.data.data.products.edges[myproducts.data.data.products.edges.length - 1].cursor; hasNextPage = myproducts.data.data.products.pageInfo.hasNextPage; } res.send(myproducts.data);
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!