FulfillmentOrders always returning empty for orders in GraphQL API

Solved
Highlighted
Tourist
5 1 1

Hi,

I'm having trouble with the graphQL API (2020-10)

For this simple query I'm running to get FulfillmentOrders for an Order:

query order($id: ID!) {
  order(id: $id) {
    createdAt
    fulfillmentOrders(first: 10) {
      edges {
        node {
          assignedLocation {
            location {
              id
            }
          }
        }
      }
    }
  }
}

 

This Query works perfectly on the Shopify GraphiQL App.

But when running on my Custom app, fulfillmentOrders always returns empty edges!

The app has the appropriate access, and can return all the other different properties of an Order.

Is there an issue going on with the API?

Thanks

0 Likes
Highlighted
Tourist
5 1 1

Update. I have found that the assignedLocations will only be populated if our default Location is used in that order. So if 2 locations were used, it will only return 1.

If a location was used that wasn't the default location, it will return blank.

Any idea why this is?

0 Likes
Highlighted
Tourist
5 1 1

This is an accepted solution.

Update. Gave up and went with the REST solution at https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillmentorder

There is definitely a bug in the GraphQL API that doesn't give you permission to see locations that aren't default. And it's even more annoying that it works perfectly in Shopify GraphiQL App. So you're convinced it is a problem in your code. Shame I spent a whole day on this.

0 Likes