Shopify node graphql timeout

I’ve been trying to integrate shopfiy with my backend, running off of a node server. Right now, I’m trying to complete a checkout using Stripe, but every API call I try has been returning a timeout error. For reference, here is the query that I’m trying right now:

const completeCheckout = `
    mutation checkoutCompleteWithTokenizedPaymentV2($checkoutId: ID!, $payment: TokenizedPaymentInputV2!){
      checkoutCompleteWithTokenizedPaymentV2(checkoutId: $${checkoutId}, payment: $${paymentInput} ) {
        checkout {
          id
        }
        checkoutUserErrors {
          code
          field
          message
        }
        payment {
          id
        }
      }
    }`
    await shopify.graphql(completeCheckout).then(content => console.log(content)).catch(e => console.log(e))

Where shopify is defined as such:

const shopify = new Shopify({
  shopName: config.api.storeFrontName,
  apiKey: config.api.shopifyKey,
  password: config.api.shopifyPassword,
})

Whenever this mutation is fired however, I always get a timeout error. Is there anything wrong with my query? And for future reference, what’s the best way to fix timeout errors in the shopify API?

1 Like

Hey @hsadev ,

That is strange and unusual that you are seeing a timeout error from Shopify. Could you provide more detail as to what the specific HTTP Error Code you are getting in response from Shopify (is it a 408?), as well as the value of the X-Request-ID header from the response from Shopify?

Also, can you verify that your app has the access scope of “unauthenticated_write_checkouts” enabled in order to complete this mutation?

Hey, the unauthenticated_write_checkouts, unauthenticated_read_checkouts box is checked for me. As for the error, it doesn’t quite say, only timing info. What’s interesting, however, is that when I tried the mutation on the GraphiQL App, it stated that the type TokenizedPaymentInputV2 does not exist. Is this an issue with the api?