Missing fields in Graph QL

Highlighted
Shopify Partner
14 0 0

I was planning to migrate from Admin API to Graph QL bulk API export. I identified that many of the fields are missing in the Graph QL object. for example in Order table few of the missing fields are 
- number
- order_number
- processing_method
- referring_site
- source_name
- token
- cart_token
- checkout_token

They are also not available In connected fields or connections of Order object in graph QL. Is there a way to get these fields?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
38 4 4

Hey @AshwiniSharma,

The Admin GQL API supports the following filter directly on QueryRoot.orders:
- source_name
- cart_token
- checkout_token

For referring_site, the CustomerVisit object (connected to the Order object via the firstVisit/lastVisit fields in the CustomerJourney object) contains the referrerUrl, in addition to more granular information about customer behaviour prior to ordering.
For processing_method, refer to the SuggestedOrderTransaction object and associated parentTransaction field. The information here is also more granular than the REST processing_method property.
For number/order_number, the GQL API doesn't currently expose this, however the name field on the Order object functions similarly.

Hope that helps!

Callum | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
14 0 0

The Admin GQL API supports the following filter directly on QueryRoot.orders:
source_name
cart_token
checkout_token

Error Message: "Invalid bulk query: Field 'checkout_token' doesn't exist on type 'Order'"


Thanks for replying,
My use-case will only use `updated_at` as a filter. I want to fetch all the fields of Order table which Admin API returns through GraphQL Bulk API. Is this feasible? What are fields that GraphQL doesn't support which are supported in Admin REST API with respect to the Order table?

I also found many of the fields missing in Order child tables that I have created. Some of them are 

DISCOUNT APPLICATION
- type
- title
- code
- description
- value_type
 
ORDER LINE
- pre_tax_price
 
REFUND
- restock
 
TRANSACTION
- device_id
- source_name
- message

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
38 4 4

@AshwiniSharma Here's an example query and response that uses the checkout_token as a filter (you could also use source_name or cart_token etc):

{
  orders(first:10, query:"checkout_token:4fcd7bd4656e68f463af4eec3556163c") {
    edges {
      node {
        id
        displayFinancialStatus
      }
    }
  }
}
{
  "data": {
    "orders": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Order/1938838847510",
            "displayFinancialStatus": "PAID"
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 12,
      "actualQueryCost": 3,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 997,
        "restoreRate": 50
      }
    }
  }
}

checkout_token isn't available as a return node on Orders in the GraphQL Admin API, but it can be used to retrieve a specific order in this way.

There unfortunately isn't a comprehensive list of the differences between the REST and GraphQL API, so I'd encourage you to explore the GraphQL API documentation further.

Callum | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes