How can I get order_number using GraphQL

Solved
Shopify Partner
7 0 0

Hi everyone!
I want to get an order using GraphQL.
Most will work but you can not get order_number.
Does anyone know how to get order_number?

I tried following:

{
  order(id: "gid://shopify/Order/order-id") {
    id
    name
    orderNumber
  }
}

but I couldn't get order_number

0 Likes
Highlighted

Success.

Community Manager
Community Manager
618 45 81

Hi @developement_st,

 

With GraphQL, the schema will have every available field shown. You can view it here: https://help.shopify.com/en/api/graphql-admin-api/reference.

 

In this case, the order_number field, as it is in the REST API, is not currently exposed in the GQL API. That said, the name field will include the order_number.

 

Cheers,

1 Like