Questions and discussions about using the Shopify CLI and Shopify-built libraries.
I'm trying to subscribe to the bulk operation I created, but when I try the instructions from "https://shopify.dev/api/usage/bulk-operations/queries" I receive the error "Argument 'topic' on Field 'webhookSubscriptionCreate' has an invalid value (BULK_OPERATIONS_FINISH)."
What am doing wrong?
mutation {
webhookSubscriptionCreate(
topic: BULK_OPERATIONS_FINISH
webhookSubscription: {
format: JSON,
callbackUrl: "https://12345.ngrok.io/"}
) {
userErrors {
field
message
}
webhookSubscription {
id
}
}
}
Thank you!
Solved! Go to the solution
This is an accepted solution.
Hey @danielfrancisco
Sounds like you might be posting to the 2021-07 version of the API. I say that as BULK_OPERATIONS_FINISH topic is included in the RC Candidate of our 2021-10 API, and if I take your query and post again against api/2021-10/graphql.json my webhook subscription is created and I'm good to go. Let me know how that goes!
This is an accepted solution.
Hey @danielfrancisco
Sounds like you might be posting to the 2021-07 version of the API. I say that as BULK_OPERATIONS_FINISH topic is included in the RC Candidate of our 2021-10 API, and if I take your query and post again against api/2021-10/graphql.json my webhook subscription is created and I'm good to go. Let me know how that goes!
Still having the same issue on 2021-10
here is my Node js client.js file
import ApolloClient from "apollo-boost";
export const createClient = (shop, accessToken) => {
return new ApolloClient({
uri: `https://${shop}/admin/api/2021-10/graphql.json`,
request: operation => {
operation.setContext({
headers: {
"X-Shopify-Access-Token": accessToken,
"User-Agent": `shopify-app-node ${process.env.npm_package_version
} | Shopify App CLI`
}
});
}
});
};
Hey @w1am
It’s a bit of a long shot here as I can’t see the server.js file, but in server.js, is your API version set to API_VERSION: ApiVersion.October21? That particular hook would have been an invalid value prior to 2020-10. Hope that helps!
Hi, I updated the shopify api package via "npm update" but still ApiVersion.October21 is not available.
Please help
App must set security headers to protect against click jacking.
Your app must set the proper frame-ancestors content security policy directive to avoid click jacking attacks. The 'content-security-policy' header should set frame-ancestors https: //[shop]. myshopify.com https://admin.shopify.com, where [shop] is the shop domain the app is embedded on.