A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
API REST has order.source_name
https://shopify.dev/docs/admin-api/rest/reference/orders/order#index-2020-04
and Graphql what is the field value?
https://shopify.dev/docs/admin-api/graphql/reference/object/order
Try this:
# Get the last 10 orders
{
orders(first: 10, reverse: true) {
edges {
node {
id
name
publication {
name
app {
title
}
}
}
}
}
}
I tried that and got:
"publication": {
"name": "Online Store",
"app": {
"title": "Online Store"
}
}
}
but the API REST, returns :
web, pos, shopify_draft_order, iphone, and android.
How I can get this?
Its a bug from Graphql ? where I can report this??
There are some noted differences between the REST API and the GraphQL API. While the GraphQL API is more standardized and powerful in terms of efficiency, it lacks a bit of the functionality of the REST API when it comes to the details. The devil and in the details after all, so there apparently are some disconnects.
The Shopify staff monitor the forums, so I'm sure they could chime in here. @_JB any feedback?
In Shopify documentation, blogs, forums, the Shopfy Stuff always enconruge developers to use GraphQL that will be the best option.
But still lack a lot of information...
I'm using Bulk Operation to get Order Shopify data, I need this information.
I can't refactor and discard GraphQL to API REST, it has limit like limits for request per second and information size data.
So the GraphQL API will return the origination source for an order --- Shopify POS, Online Store, etc. But you are looking for even more granular specifics for each order then? I'm re-reading your earlier posts on this thread.
For example, you need to know that an order originated from the online store based on the customer using an iPhone? That is pretty granular. In those cases it might make more sense to use Google Analytics to cross-reference things.
Shopify already has all this information.
I need this info but in the Graphql response.
https://xxxx/admin/orders/xxxx.json
API REST returns:
...
"client_details": {
"browser_ip": "xxxxx",
"accept_language": "en-us",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1",
"session_hash": null,
"browser_width": 414,
"browser_height": 725
},
...
processing_method": "direct",
"checkout_id": xxxxx,
"source_name": "web",
"fulfillment_status": null,
....
I get what you're saying. But if you have a goal in mind, you have to look at the available tools for the job. Unfortunately the solution to achieving your goal involves working with more than a single API resource. In this case, both the Shopify REST API and the Shopify GraphQL API. The Shopify staff monitor these forums, so any API enhancement requests, bug reports, etc. will get onto their radar. But if you need to develop a solution in the here and now, you will need to make some API requests using the REST API, while making other API requests using the GraphQL API. I have a few projects that bounce between both. The time it takes to research the forums, deliberate about options, and the like can be more than it takes to actually dig in and build the API queries that will do the job.
Of course the REST API has rate limits and other limiting factors that come into play. But again, we are given tools to do the job. Some tools are sharper than others. Until the GraphQL has been fully built out to match the attribute depth of the REST API, it's the best tools we have!
We are having the exact issue with Shopify's GraphQL API.
Are there any recent updates regarding Order.source_name on Shopify's GraphQL API?
Thanks
hey did you get an answer to this? I have the same question.
hi @chriscoyne , You can query the order.app in GraphQL to find the Application that created the order. Or query Orders and filter by 'sales_channel'.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog