Trouble with GraphQL Pagination in n8n

Hey there,

I’m currently facing an issue with GraphQL pagination when using the HTTP Node in n8n.

Whenever I attempt to implement pagination in my query, only the first page of results is returned repeatedly. For example, if I try to loop through 50 pages, it just returns the first page 50 times.

Here’s the query I’m using:

{
“query”: “query ($cursor: String) { boards(ids: 7897800345) { items_page(limit: 100, cursor: $cursor, query_params: { operator: and, rules: [ { column_id: "date_mksrqjfm", operator: lower_than, compare_value: ["EXACT", "{{ $(‘Date & Time’).first().json.formattedDate }}"] }, { column_id: "from_where9__1", operator: contains_terms, compare_value: ["Propstream"] }, { column_id: "numeric_mksfrh3k", operator: not_any_of, compare_value: ["1"] }, { column_id: "text_mkmqen64", operator: contains_terms, compare_value: ["Tulsa"] } ] }) { cursor items { id name column_values(ids: ["lead_phone", "date_mksrqjfm", "numeric_mksrvs2f", "phone_mksrvk6t", "from_where9__1", "text6__1", "status_mksrx8kq", "text_mkmqen64", "text5__1", "text_mkt927r", "text_mkt9ta68"]) { id text } } } } }”,
“variables”: {
“cursor”: null
}
}

In the n8n HTTP Request node documentation, for APIs that require dynamic parameters, they recommend using Update a Parameter in Each Request mode, where you manually define how the parameter changes between calls. This involves managing the cursor variables yourself within the GraphQL body.

HTTP Request node:
Method: POST → Format: JSON
Pagination Mode: Update a Parameter in Each Request
Type: Body
Name: variables.cursor
Value: {{ $json.pageInfo.hasNextPage ? $json.pageInfo.endCursor : null }}

I’m not that user, but I have a question about this method. When I’ve tried, I’ve noticed that it doesn’t seem to update the cursor used in the little parameter section. No matter what naming structure I’ve tried, it just doesn’t seem to actually change the json that goes through, it just does the same initial one over and over. :upside_down_face:

Anyone else notice a potential bug? Maybe the Name section can’t actually update it?

Edit, actually, it looks like this might be the bug: Pagination in Body Object only in first call · Issue #12498 · n8n-io/n8n · GitHub seems like variables.cursor (or anything with dot notation) will not work for the time being.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.