Missing fields - How can i get name, order_status_url, order_number in Order using GraphQL?

ravindrapatel
Tourist
10 0 0

Hello Guys,

I am trying to get an order using GraphQL but couldn't get name, order_status_url, order_number, discount_codes, source_name ... and many more fields.

But on REST API i get all the above fields.


Is there any way to get all fields using GraphQL which available on REST API?

0 Likes
BStubbs
Shopify Partner
127 14 51

with GraphQL you have to specify the fields you want to get, so if you want those fields, you have to ask for them. Keep in mind some of them will be in other objects, like customer name will be in the Customer object etc.

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
0 Likes
ravindrapatel
Tourist
10 0 0

@BStubbs 

You are right for specify fields in query but i didn’t get any fields mentioned in question and also not found in any object for order.

Thank you for your response.

0 Likes
BStubbs
Shopify Partner
127 14 51

What is the error message you get?

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
0 Likes
ravindrapatel
Tourist
10 0 0

@BStubbs 

As per Shopify GraphQL Order Object missing several fields like name, order_status_url, order_number compare to REST API Order Object

so when i do query with above fields i get this error.

Field 'order_status_url' doesn't exist on type 'Order'


So the question was about How i get that missing fields on GraphQL Order Object.

 
0 Likes
BStubbs
Shopify Partner
127 14 51

You need to check the GraphQL docs. It's a completely different API, not just a different language. 

The error you are getting tells you the problem, 'order_status_url' isn't available on GraphQL. You need to use REST API for that.

The available fields for GraphQL can be found here: https://shopify.dev/docs/admin-api/graphql/reference/orders/order?api%5Bversion%5D=2021-01#fields-20...

 

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
0 Likes