<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GraphQL- Shopify Pagination in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/GraphQL-Shopify-Pagination/m-p/4733607#M8037</link>
    <description>&lt;P&gt;Thanks for the reply. I ended up going with the same solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone else reading this: I had to wrap the initial load in an outer Lookup and Copy activity with a date-sorted filter to get the first batch of data. That way, I could use the resulting end cursor inside the Until loop. From my experience, setting the end cursor variable to null or blank isnt allowed.&lt;/P&gt;&lt;P&gt;Not sure if that’s the "correct" approach, but it worked for me.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jun 2025 13:09:10 GMT</pubDate>
    <dc:creator>Siboska</dc:creator>
    <dc:date>2025-06-16T13:09:10Z</dc:date>
    <item>
      <title>GraphQL- Shopify Pagination</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/GraphQL-Shopify-Pagination/m-p/4731436#M8011</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’m building an ADF pipeline to pull &lt;STRONG&gt;all orders&lt;/STRONG&gt; from Shopify’s GraphQL API into an Azure SQL database, and I’m stuck on the pagination logic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I’ve tried so far&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Use a &lt;STRONG&gt;Lookup&lt;/STRONG&gt; activity to run the first GraphQL query (no after cursor) and extract&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Store endCursor in a pipeline variable afterCursor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. Until loop&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Condition: @equals( variables('hasNextPage'), false )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Copy&lt;/STRONG&gt; (or Lookup) activity using a dynamic body that injects after:$afterCursor when it’s non-empty&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Set variable&lt;/STRONG&gt; → capture the new endCursor and hasNextPage from the JSON&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Write out the nodes array to SQL&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;First-page query&lt;/STRONG&gt; (Lookup):&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;@concat(
  '{',
    '"query":"query GetOrders($first:Int!,$filter:String){',
      'orders(first:$first, sortKey:CREATED_AT, reverse:true, query:$filter){',
        'nodes{',my fields....',
        '} ',
        'pageInfo{hasNextPage endCursor}',
      '}',
    '}",',
    '"variables":{',
      '"first":250,',
 
      concat(
        '"filter":"created_at:&amp;gt;',
        variables('lastOrderDate'),
        '"'
      ),
    '}',
  '}'
)&lt;/LI-CODE&gt;&lt;H3&gt;&lt;STRONG&gt;Loop query&lt;/STRONG&gt; (Copy or Lookup inside Until):&lt;/H3&gt;&lt;LI-CODE lang="javascript"&gt;@concat(
  '{',
    '"query":"query GetOrders($first:Int!,$after:String,$filter:String){',
      'orders(first:$first',
        if(
          empty(variables('afterCursor')),
          '',
          concat(', after:\"', variables('afterCursor'), '\"')
        ),
      ', sortKey:CREATED_AT, reverse:true, query:$filter){',
        'nodes{…} pageInfo{hasNextPage endCursor}',
      '} }",',
    '"variables":{',
      '"first":250',
      
      if(
        empty(variables('afterCursor')),
        '',
        concat(', "after":"', variables('afterCursor'), '"')
      ),
      
      concat(
        ', "filter":"created_at:&amp;gt;',
        coalesce(variables('lastOrderDate'),'1990-01-01T00:00:00Z'),
        '"'
      ),
    '}',
  '}'
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;Where I’m stuck&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;I can extract &lt;STRONG&gt;the first&lt;/STRONG&gt; endCursor outside the loop, but once inside the Until, I don’t know how to capture and reuse &lt;STRONG&gt;each subsequent&lt;/STRONG&gt; endCursor that the Copy activity returns.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Copy activitys output only exposes metrics (rowsCopied, throughput, etc.), not the JSON body.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;P&gt;&lt;STRONG&gt;Can anyone&lt;/STRONG&gt; advise:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;A simpler pattern for Shopify GraphQL pagination in ADF?&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;How to “read” the next endCursor inside the loop (from a Copy or Lookup) so I can feed it back into the next iteration?&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks in advance for any guidance!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2025 11:00:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/GraphQL-Shopify-Pagination/m-p/4731436#M8011</guid>
      <dc:creator>Siboska</dc:creator>
      <dc:date>2025-06-13T11:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: GraphQL- Shopify Pagination</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/GraphQL-Shopify-Pagination/m-p/4733165#M8033</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424762" data-lia-user-login="Siboska" class="lia-mention lia-mention-user"&gt;Siboska&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as per above query since you have mentioned the Copy activity does not contain the response body, so you are not able to access values like needed&amp;nbsp;&lt;STRONG&gt;endCursor&lt;/STRONG&gt; and &lt;STRONG&gt;hasNextPage&lt;/STRONG&gt; for pagination. Instead, can you please try using a Lookup activity, which does include the full JSON response and allows you to extract the necessary data for paginated requests. please let us know if this helps you resolve your issue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Prashanth Are&lt;/P&gt;
&lt;P&gt;MS Fabric Community Support&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you find this answer helpful please mark it &lt;STRONG&gt;accept as solution&lt;/STRONG&gt; by doing so, this will help community members find asnwers quickly for similar issues.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 08:45:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/GraphQL-Shopify-Pagination/m-p/4733165#M8033</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-06-16T08:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: GraphQL- Shopify Pagination</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/GraphQL-Shopify-Pagination/m-p/4733607#M8037</link>
      <description>&lt;P&gt;Thanks for the reply. I ended up going with the same solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone else reading this: I had to wrap the initial load in an outer Lookup and Copy activity with a date-sorted filter to get the first batch of data. That way, I could use the resulting end cursor inside the Until loop. From my experience, setting the end cursor variable to null or blank isnt allowed.&lt;/P&gt;&lt;P&gt;Not sure if that’s the "correct" approach, but it worked for me.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 13:09:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/GraphQL-Shopify-Pagination/m-p/4733607#M8037</guid>
      <dc:creator>Siboska</dc:creator>
      <dc:date>2025-06-16T13:09:10Z</dc:date>
    </item>
  </channel>
</rss>

