Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

shopify node graphql timeout

shopify node graphql timeout

hsadev
Visitor
2 0 1

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? 

Replies 2 (2)

hassain
Shopify Staff (Retired)
624 104 189

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?

 

To learn more visit the Shopify Help Center or the Community Blog.

hsadev
Visitor
2 0 1

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?