A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hello,
I am getting this error after using orderInvoiceSend graphql api
{"errors":[{"message":"Internal error. Looks like something went wrong on our end.\nRequest ID: cda305fd-284f-452b-a889-dafb445938ce (include this in support requests).","extensions":{"code":"INTERNAL_SERVER_ERROR","requestId":"cda305fd-284f-452b-a889-dafb445938ce"}}]}
this is how im building my query and consuming the api
const GraphClient = new Shopify.Clients.Graphql(StoredSession.shop, StoredSession.accessToken);
const queryString ={"query":`mutation orderInvoiceSend($id: ID!) {orderInvoiceSend(id: $id) {order {id} userErrors {field message}}}`,
"variables": {
"email": {
"bcc": [""],
"body": "hi",
"customMessage": "hi",
"from": "example@hotmail.com",
"subject": "invoice",
"to": "example@hotmail.com"
},
"id": "gid://shopify/Order/4814922940652"
}
};
console.log(queryString);
const orderInvoice = await GraphClient.query({
data:queryString,
extraHeaders:{"Content-Type":"application/json"}
});
can someone help? thanks
Solved! Go to the solution
This is an accepted solution.
The email argument was missing in the mutation and the EmailInput.bcc was empty which was causing the error.
this is my updated query
const queryString = {
"query": `mutation orderInvoiceSend($id: ID!, $email: EmailInput) {orderInvoiceSend(id: $id, email:$email) {order {id email} userErrors {field message}}}`,
"variables": {
"email": {
"bcc": ["example@hotmail.com"],
"body": "hi",
"customMessage": "hi",
"from": "example@elationerp.com",
"subject": "invoice",
"to": "example@hotmail.com"
},
"id": "gid://shopify/Order/4814922940652"
}
};
This is an accepted solution.
The email argument was missing in the mutation and the EmailInput.bcc was empty which was causing the error.
this is my updated query
const queryString = {
"query": `mutation orderInvoiceSend($id: ID!, $email: EmailInput) {orderInvoiceSend(id: $id, email:$email) {order {id email} userErrors {field message}}}`,
"variables": {
"email": {
"bcc": ["example@hotmail.com"],
"body": "hi",
"customMessage": "hi",
"from": "example@elationerp.com",
"subject": "invoice",
"to": "example@hotmail.com"
},
"id": "gid://shopify/Order/4814922940652"
}
};