I’m working with Shopify APIs and running into issues when trying to convert my REST API calls to GraphQL. The problem is specifically with the referring_site field from order data.
When I fetch order information using the REST API, I get certain values for the referring site. But when I try to get the same data through GraphQL queries, I’m either getting null values or completely different results for identical orders.
I’m wondering if there’s a proper way to handle this field mapping between the two API types. Also, does the REST API consistently return referring site information for all orders, or are there cases where it might be empty?
Has anyone else experienced similar discrepancies when migrating from REST to GraphQL for Shopify order data? What’s the correct GraphQL field that corresponds to the REST API’s referring_site property?
This happens because the APIs pull from different data sources. GraphQL’s referringSite field uses a different tracking mechanism than REST, which creates inconsistencies - especially for orders from different checkout methods or mobile apps. REST captures more referral data since it uses older, more permissive tracking. GraphQL is stricter about validation and drops referral sources that don’t meet its criteria. I see this a lot with embedded checkout flows and certain payment gateways. For your migration, try querying GraphQL first, then fall back to REST when GraphQL returns null for referring site data. This keeps your data consistent across both APIs.
Same issue here! Check the referringSite field in your order object. Mine was null even though REST showed data - might be a Shopify timing thing. Make sure your GraphQL query actually includes that field, fixed it for me!
You’re hitting a common issue with how Shopify handles referral data between REST and GraphQL. The field names match up (referring_site vs referringSite), but they work differently under the hood. REST grabs the referral info when the order’s created, while GraphQL uses newer tracking that wasn’t around for older orders. That’s why you’re getting nulls in GraphQL for orders that show data in REST. GraphQL also has stricter validation, so it filters out referral values that REST considers valid. I’ve seen this hit orders from certain checkout flows and third-party integrations the hardest. For your migration, I’d stick with REST calls for historical orders and only use GraphQL for new stuff.
Yeah, this is super annoying - GraphQL filters out referring_site way more aggressively than REST. I’ve seen orders from social media platforms get dropped completely in GraphQL while they show up fine in the REST API. You might want to check the customerJourney field as well.