GraphQL bulk job gives different results in Shopifys GraphiQL app and when executed from my own app

Solved
Highlighted
Shopify Partner
50 2 6

Hi,

 

Can anybody help me with a plausible explanation of why a bulk job query in the GraphiQL app gives a different result than when the same query is executed via my own app?

 

When I run my own app, I write the GraphiQL query to the console and copy it to the GraphiQL app, to ensure it is the exact same query. 

When I execute the query in the GraphiQL app, it gives one more order in the result, than when I execute the same query in my app. It only happens for a specific date, i.e. the difference is not consistent. The order that is "extra" in the GraphiQL result is from april (i.e. it's not the case that the GraphiQL app has access to all orders, and my app does not, and the additional order is more than 6 months old). The result from GraphiQL seems to be the correct result, as the query is on orders changed after a given date, which the "extra" order is according to its updated_at date (the updated_at value for the "extra" order is "2020-06-06T08:07:07Z").

The query is:

mutation {
    bulkOperationRunQuery(
      query: """
      {
        orders(query: "updated_at:>=2020-06-06") {
          edges {
            node {
              id
              name
              totalPriceSet {
                shopMoney {
                  amount
                }
              }
              shippingLine {
                discountedPriceSet {
                  shopMoney {
                    amount
                  }
                }
              }
              publication {
                name
              }
              transactions {
                id
                amountSet {
                  shopMoney {
                    amount
                  }
                }
                gateway
                formattedGateway
                receipt
                test
                kind
                status
                createdAt
              }
              shippingAddress {
                countryCodeV2
              }
              billingAddress {
                countryCodeV2
              }
              createdAt
              updatedAt
            }
          }
        }
      }

      """
    )  {
      bulkOperation {
        id
        status
      }
      userErrors {
        field
        message
      }
    }
  }

Thanks,

-Louise

0 Likes
Highlighted
Shopify Partner
50 2 6

This is an accepted solution.

ARGH no - just realized that the read_all_orders scope is now required for orders older than 60 days - not 6 months as I believe it was previously.

Which explains the difference - the GraphiQL app is installed with all scopes including read_all_orders, and my app does not have this scope, and the "extra" order is from the 5th of April, i.e. it's older than 60 days....

1 Like