Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
Hello Developers,
I have written below gql code but getting error . error is not clear, my code is,
const mailResponse = await client.query({
data: `mutation customerPaymentMethodSendUpdateEmail(gid://shopify/CustomerPaymentMethod/${paymentId}: ID!) {
customerPaymentMethodSendUpdateEmail(customerPaymentMethodId: $customerPaymentMethodId) {
customer {
# Customer fields
id
email
}
userErrors {
field
message
}
}
}
`,
});
and error is
┃ [{"message":"Parse error on \"gid\" (IDENTIFIER) at [1, 47]","locations":[{"line":1,"column":47}]}] mailResponse
I think the issue is coming from the parsing of id parameter of the mutation. See this example here https://stackoverflow.com/questions/56090799/shopify-graphql-mutation-returns-parse-error-on-gid-ide...
i would recommend using the variables keyword defined within the query client see example here for node js. Note that the id is passed through the variable and not directly:
https://shopify.dev/api/admin-graphql/2022-04/mutations/customerDelete
All the best!
User | RANK |
---|---|
11 | |
8 | |
6 | |
5 | |
4 |