Solved

Argument 'topic' on Field 'webhookSubscriptionCreate' has an invalid value (BULK_OPERATIONS_FINISH).

danielfrancisco
Visitor
1 0 0

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! 

Accepted Solution (1)

Luke_K
Shopify Staff
402 66 98

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!

 

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!

View solution in original post

Replies 5 (5)

Luke_K
Shopify Staff
402 66 98

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!

 

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
w1am
Shopify Partner
9 0 3

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`
        }
      });
    }
  });
};

 

Luke_K
Shopify Staff
402 66 98

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!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
Veesy
Shopify Partner
13 0 4

Hi, I updated the shopify api package via "npm update" but still ApiVersion.October21 is not available.

Balouchi
Excursionist
44 0 8

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.