# NodeJs - ApolloClient.query() with cursor pagination

**URL:** <https://community.apollographql.com/t/nodejs-apolloclient-query-with-cursor-pagination/6724>\
**Category:** Client SDKs\
**Tags:** client\
**Created:** [September 15, 2023, 7:51am UTC](https://community.apollographql.com/t/nodejs-apolloclient-query-with-cursor-pagination/6724 "2023-09-15T07:51:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GuplerSaxanoid](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/guplersaxanoid/32/4581_2.png) [@GuplerSaxanoid](https://community.apollographql.com/u/GuplerSaxanoid)\
**Post date:** [September 15, 2023, 7:51am UTC](https://community.apollographql.com/t/nodejs-apolloclient-query-with-cursor-pagination/6724/1 "2023-09-15T07:51:09Z")

</div>

how does `ApolloClient.query()` behave when using cursor for pagination?  
here is my query:

```auto
query MyQuery {
  events {
    edges {
      cursor
      node {
        blockHeight
      }
    }
    pageInfo {
      endCursor
      hasNextPage
    }
  }
}

```

it’s behaves as expected when querying directly from the graphql endpoint, it returns the first few entries along with endCursor that I can use to retrive next page. But, when using ApolloClient.query() method, it seems to skip over all the starting entries and return the last few pages. Is it possible that ApolloClient.query() is making repeated queries for consecutive pages and overwriting the previous ones? I also see that the response time is abnormally high and it timeouts at db level more often than not.

---

<div class="post-metadata">

**Author:** ![JeffAuriemma](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/jeffauriemma/32/2845_2.png) [@JeffAuriemma](https://community.apollographql.com/u/JeffAuriemma)\
**Post date:** [September 25, 2023, 7:49pm UTC](https://community.apollographql.com/t/nodejs-apolloclient-query-with-cursor-pagination/6724/2 "2023-09-25T19:49:05Z")

</div>

Hi @GuplerSaxanoid 👋 welcome to the forum! Can you post some sample code from your client application, including any arguments you’re passing to the `ApolloClient#query` method?

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/nodejs-apolloclient-query-with-cursor-pagination/6724/3 "2025-02-06T20:48:16Z")

</div>


