GraphQL query taking too much time and returning 401 unauthorized

Hello,

I am trying to fetch fulfilled orders for the Shiphero accounts that I’m working with and I’ve been having the following issues with them recently:

  • Queries that ran almost instantly now take >50s to complete

  • Only for the new account that I’m working with I get the following message: 401, message=‘UNAUTHORIZED’, url=URL(‘https://public-api.shiphero.com/graphql’)

Any idea why this only happens with the new account, and not the old, and why the query is taking so long. Here is my query:

query ($current_timestamp:ISODateTime!) {
    orders(fulfillment_status:"fulfilled" order_date_from:$current_timestamp) {
      request_id
      complexity
      data (first:100) {
        pageInfo {
          hasNextPage
          startCursor
          endCursor
        }
        edges {
          cursor
          node {
            id
            order_number
            partner_order_id
            required_ship_date
            shop_name
            fulfillment_status
            order_date
            total_price
            total_discounts
            total_tax
            subtotal
            box_name
            email
            shipping_lines {
              title
              carrier
              method
              price
            }
            shipping_address {
              address1
              address2
              city
              state
              zip
              country
            }
            saturday_delivery
            alcohol
            expected_weight_in_oz
            currency
            has_dry_ice
            shipments {
              shipped_off_shiphero
              shipping_labels {
                tracking_number
                status
                carrier
                shipping_name
                shipping_method
                cost
                delivered
                refunded
                needs_refund
                insurance_amount
                created_date
                dimensions {
                  length
                  width
                  height
                  weight
                }
                address {
                  address1
                  address2
                  city
                  state
                  country
                  zip
                }

              }
            }

          }
        }
      }
      }
      }

Hey @saladass4254!

Thanks for reaching out.
I’m going to look into this and get back to you, but could you provide me with a request id that the query returns in the meantime?

Best,
RayanP

@sh-agent thanks for getting back! The query is not returning a request ID. When I use a GraphQL client like Altair, I’m getting a 504 error, and when I run it using gql in Python, I’m getting the unauthorized message. I’m happy to share the tokens via DM with you

1 Like