Shopify GraphQL walkthrough
Shopify is a cloud-based e-commerce platform that enables businesses to manage products, orders, payments, and customer data. You can integrate Shopify with GraphQL in Data Integration.
Objects overview
Shopify’s GraphQL API provides access to a wide range of business objects, including products, orders, customers, and more. Each object contains fields and relationships used to query as per your integration needs. For more information, refer to Shopify’s GraphQL documentation.
Supported Objects include:
These objects are used to query and load into your target system for downstream reporting and analytics.
Using Shopify GraphQL integration
Procedure
Step 1: creating a Shopify GraphQL connection
- Log in to the Data Integration console.
- On the left-hand menu, click + Create River.
- Select Source to Target River.
- A list of available sources appears. From this list, choose Shopify GraphQL.
- Under Source Connection:
- Choose an existing connection, or
- Click New Connection.
- Click Test Connection to verify that your Shopify account is successfully connected.
- Under Choose your River mode, select Multi-Tables.
- This option enables you to select and extract multiple Shopify GraphQL objects simultaneously.
Step 2: choosing your target
- Select your Target Connection.
- Refresh and choose the Database and Schema where you want the store data.
- Choose Default Loading Mode for your Multi-Tables migration. For more information, refer to Targets.
- In Additional options, you can toggle options such as Truncate Columns, Replace Invalid UTF-8 Characters, Replace values with NULL, and Add Rivery Metadata. For more information, Advanced settings.
Step 3: configuring the schema
The Schema tab lets you select source objects, configure extraction and loading rules, and define how data flows into your target system.
-
Navigate to the Schema tab.
-
Review the list of Source objects displayed.
-
Use the search bar to find an object quickly.
-
Turn on the checkbox next to each object you want to load, or select all objects using the checkbox at the top.
-
Confirm the Status Tracked for selected objects.
-
(Optional) Click Edit for any object to adjust:
-
Columns tab:
- Source Column: Original field from Shopify; select the checkbox to include or exclude fields and control the data loaded.
- Target Column: Field name in the target; click to rename or click Reset to restore default mappings.
- Type: Click the drop-down to select the data type, for example, STRING, VARIANT, INTEGER, or TIMESTAMP, so values are stored and queried correctly.
- Mode: Click the drop-down to choose NULLABLE, REQUIRED, or REPEATED to enforce field constraints.
- Cluster Key: Select the checkbox to mark fields as clustering keys for optimized query performance.
- Calculated Columns: Click + Add Calculated Column to create custom fields for enrichment or transformation.
- Reload Metadata: Click Reload Table Metadata to refresh schema definitions whenever source objects change.
- Three-dot menu (⋮): Click to access quick schema management options:
- Show all: Display every column in the object.
- Show selected columns: Display only the fields chosen.
- Show key columns: Focus on fields marked as clustering keys.
- Reset all changes: Revert all mappings and settings to default.
-
Table Settings tab:
-
Source Settings:
- Extraction Mode: Click the drop-down to select All full dataset or Incremental only new or updated records.
- Incremental Field: Click the drop-down to choose the field, for example, createdAt or updatedAt, used for incremental extraction.
- Date Range Start and End: Click to set start and end dates to limit data extraction.
- Include End Value: Select the checkbox to include records that match the end date in the extraction.
- Interval Chunk Size optional: Click to define chunk size, for example, daily or weekly to split large extractions into smaller runs.
-
Target Settings:
- Target Table Name: Click the field to rename the destination table.
- Merge Method: Click the drop-down to choose how data updates the target: Append, Upsert-Merge, or Overwrite.
- Loading Mode: Click the drop-down to configure how data is loaded.
- Deduplication Logical Key: Click the field to set a logical key that prevents duplicate rows during loads.
-
-
-
Click Save to store the schema settings.
Step 4: configuring settings
The Settings tab lets you configure scheduling, timeouts, and notifications for your River.
-
Click Schedule Me! to set when and how often the River should run (UTC zone).
-
Click the drop-down under Timeout River execution after to choose the maximum runtime. The default is 12 hours.
-
Notifications:
- Turn on the toggle On Failure to receive alerts if a River run fails.
- Turn on the toggle On Warnings to get notified when non-critical issues occur.
- Turn on the toggle On Run Time Threshold to get alerts if a run exceeds the expected execution time.
-
Click Save to apply your settings.
Step 5: running your river
- After the setup is complete, click Save.
- Click Run to run your River.
- Monitor the execution logs to validate successful extraction and loading.
Troubleshooting
If you encounter the error: [RVR-SHPY-201]: Received invalid response from Shopify API: HTTP error occurred: 500 Server Error: Internal Server Error.
- This points to a general Shopify-side 500 error, which shuts down the run.
- It indicates a temporary hiccup or a heavy query that triggers failure. It is not a problem with authorization, permissions, or schema.
- Workaround:
- Start with only the default selected fields on the Customer object.
- Then, use an Upsert-Merge approach to load additional, unselected fields gradually.
- This strategy helps you avoid overloading Shopify with heavy queries and reduces the likelihood of repeated 500 errors.