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?
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.
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.
What is the error message you get?
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.
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...