shopify node graphql timeout

Highlighted
New Member
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? 

1 Like
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

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?

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
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? 

0 Likes