Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sushantk19
Creator
Creator

Extracting the data incrementally in graphql query from shopify

Hello Team,

I have a requirement to incrementally pull the data from shopify source using graphql query. I am able to pull a small number of records through the graphql query which i am passing in talend job. I have a field "updated_At" in my source entity say order. I want to ensure that in my next job run, i pull the data incrementally i.e from the last saved value of updated_at. Can you help me with the design ? how should i handle this scenario?

Labels (3)
1 Reply
Jamesserpa
Contributor
Contributor

Hello,

 

To incrementally pull data from a Shopify source using a GraphQL query, you can follow these steps:

 

Determine the initial starting point: In your first job run, retrieve the data using your GraphQL query without any constraints on the "updated_at" field. This will give you the initial set of data to work with.

 

Identify the maximum "updated_at" value from the initial dataset: Once you have retrieved the initial data, identify the maximum value of the "updated_at" field. This will be used as the starting point for the next job run.

 

Store the maximum "updated_at" value: Save the maximum "updated_at" value in a persistent storage, such as a database or a file. This will allow you to access it in subsequent job runs.

 

Add a constraint to the GraphQL query: In your next job run, modify your GraphQL query to include a constraint on the "updated_at" field. Use the stored maximum "updated_at" value as the constraint to only fetch data that has been updated after that point.

 

Retrieve the incremental data: Execute the modified GraphQL query to retrieve the data that has been updated since the last run.

 

Process and merge the data: Once you have the incremental data, you can process it as needed and merge it with the previously retrieved data.

 

Update the maximum "updated_at" value: Identify the new maximum "updated_at" value from the combined dataset of the previous run and the incremental data. Update the stored maximum "updated_at" value to this new value, so it can be used in the subsequent job run.

 

Repeat the process: Repeat steps 4-7 in each subsequent job run to incrementally pull the updated data from the Shopify source.

 

By following this approach, you can ensure that only the data updated since the last run is fetched, allowing you to perform incremental data extraction from Shopify using a GraphQL query.