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?