Errors Returned For Successful Requests?

I’m making a simple GraphQL request using a fragment to retrieve order information. It’s a simple request:

query($recordLimit:Int=5 $itemLimit:Int=10 $cursor:String $sort:String $specificOrder:String) {
  orders(shop_name:"cocoa-via-dev.myshopify.com" partner_order_id:$specificOrder) {
    ...orderFields
  }
}

fragment orderFields on OrdersQueryResult {
  request_id
    complexity
    data(first:$recordLimit after:$cursor sort:$sort) {
        [...]
    }
}

When I run this query, the result is including an errors object. Is it expected to always return an errors object with every query, or is it meant to only return an errors object when in fact an error occurs?

{
  "errors": [
    {
      "message": "'orders'"
    }
  ],
  "data": {
    "orders": {
      "request_id": "5ee7c7edcfa49aee12aa16e1",
      "complexity": null,
      "data": {
        "pageInfo": {
          "hasNextPage": false,
          "hasPreviousPage": false,
          "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
          "endCursor": "YXJyYXljb25uZWN0aW9uOjA="
        },
        [...]
      }
    }
  }
}

Hi Brett
It looks like its an error when it calculates the complexity of that query, thanks for catching it!.
I’ve already created a ticket for our engineering team about this.
You are still able to see those orders, right?
Thanks in advance!
Tom

Yes, I can see the order data; however, the app I’m working on I built under the assumption “errors” would only appear if there was in fact an error.

I’ll adjust my app to only consider it an error if there is a code associated with it which should resolve this while your engineers fix it.

1 Like

Hi @brett
This should be solved by now, I tried it and now it seems to be working without that error message.
Let me know if its still showing you the error.
Thanks again for your patience with this!
Tom

@tomasw Thanks! I just took a look and it is in fact fixed! Thanks for that!

{
  "data": {
    "orders": {
      "request_id": "5f0ef79abfa24029a650fd4f",
      "complexity": 7,
      ...
    }
  }
}
1 Like