Where can I find the order.source_name in the Graphql API?

Highlighted
Highlighted
Shopify Partner
593 41 118

Try this:

# Get the last 10 orders
{
  orders(first: 10, reverse: true) {
    edges {
      node {
        id
        name
        publication {
          name
          app {
            title
          }
        }
      }
    }
  }
}
0 Likes
Highlighted
Excursionist
18 1 1

@Greg_Kujawa 

 

I tried that and got:

 

"publication": {
"name": "Online Store",
"app": {
"title": "Online Store"
}
}
}

 

but the API REST, returns :

webposshopify_draft_orderiphone, and android.

 

How I can get this?
Its a bug from Graphql ? where I can report this??

0 Likes
Highlighted
Shopify Partner
593 41 118

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?

0 Likes
Highlighted
Excursionist
18 1 1

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.

0 Likes
Highlighted
Shopify Partner
593 41 118

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.

0 Likes
Highlighted
Excursionist
18 1 1

@Greg_Kujawa 


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,
....

0 Likes
Highlighted
Shopify Partner
593 41 118

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!

0 Likes