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

Solved
danielfrancisco
New Member
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)

Accepted Solutions
L_J_K
Shopify Staff
363 54 65

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!

 

| API Support @ 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 3 (3)
L_J_K
Shopify Staff
363 54 65

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!

 

| API Support @ 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

w1am
New Member
3 0 0

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

 

L_J_K
Shopify Staff
363 54 65

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!

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