Really hoping someone here can help me out with this, as I can't figure out why this is happening, and the Celigo support represent I've been working with via a support ticket can't figure it out either.
Background:
I have a flow step that performs a Shopify GraphQL query to get a variety of product data. The amount of data returned requires me to perform pagination due to rate limits (I query 100 products per call as you'll see below). The queries work great, and in the preview pane, I see all records, which make me think my pagination is working. Below are some screenshots on how I have this flow step configured with the pagination:
And these are the queries I have set in the above screenshots:
{
"query": "query ($numProducts: Int!, $sku_query: String, $cursor: String) { productVariants (first: $numProducts, query: $sku_query, after: $cursor) { pageInfo { hasNextPage endCursor } edges { node { id sku legacyResourceId inventoryItem { id legacyResourceId inventoryLevels(first: 1) { edges { node { id available location { id } } } } } } } } }",
"variables" : {
"numProducts": 100,
"cursor": null,
"sku_query": "{{#each record.inventory_data as |inv_record|}}{{#compare @index ">" 0}} OR {{/compare}}sku:{{inv_record.sku}}{{/each}}"
}
}
{{#if previous_page.full_response.data.productVariants.pageInfo.hasNextPage}}
{
"query": "query ($numProducts: Int!, $sku_query: String, $cursor: String) { productVariants (first: $numProducts, query: $sku_query, after: $cursor) { pageInfo { hasNextPage endCursor } edges { node { id sku legacyResourceId inventoryItem { id legacyResourceId inventoryLevels(first: 1) { edges { node { id available location { id } } } } } } } } }",
"variables" : {
"numProducts": 100,
"cursor": "{{{previous_page.full_response.data.productVariants.pageInfo.endCursor}}}",
"sku_query": "{{#each record.inventory_data as |inv_record|}}{{#compare @index ">" 0}} OR {{/compare}}sku:{{inv_record.sku}}{{/each}}"
}
}
{{/if}}
When I preview this data, this is how the records are displayed in the "Parsed output" tab on the preview pane:
{ "page_of_records": [
{ "record":
{ "node": { [Shopify product data here] } }
},
{ "record":
{ "node": { [Shopify product data here] } }
},
{ "record":
{ "node": { [Shopify product data here] } }
},
{ "record":
{ "node": { [Shopify product data here] } }
},
[...rest of product records]
]}
In addition, when I set the debug logs on this flow step, I am seeing 8 different logs appear when I run the flow, which also makes me think that my pagination is working.
Issue:
On the Results Mapping associated with this flow step, the Preview pane is only showing me the first record. Thinking this may be a bug with the Preview, I created a Javascript hook that intentionally breaks so I can review the actual data that appears in the "Edit retry data" window of the error display, but that also only shows me the first record. Through the remainder of my flow (which is only one other flow step), I am also only seeing the first record being passed through.
That said, how can I get all the records from this paginated flow step to pass through the remainder of my flow?