1
votes

I'm setting up an app uninstall webhook for my Shopify app. My app in Shopify Developer is set to the latest API (2021-01).

However, when I register my webhook, there's no option for ApiVersion.January21. When I set it as January21 I get the following:

error: invalid JSON response body at https://test-sonder.myshopify.com/admin/api/undefined/graphql.json reason: Unexpected end of JSON input.

This is my server.js

 const { ApiVersion } = require('@shopify/koa-shopify-graphql-proxy');
 const registration = await registerWebhook({
          address: `${HOST}/webhooks/apps/uninstall`,
          topic: 'APP_UNINSTALLED',
          accessToken,
          shop,
          apiVersion: ApiVersion.January21
        });

My package.json

  {
  "dependencies": {
    "@koa/router": "^10.0.0",
    "@shopify/app-bridge-react": "^1.28.0",
    "@shopify/koa-shopify-auth": "^3.2.0",
    "@shopify/koa-shopify-graphql-proxy": "^4.1.0",
    "@shopify/koa-shopify-webhooks": "^2.6.0",
    "@shopify/polaris": "^5.12.0",
    "@zeit/next-css": "^1.0.1",
    "apollo-boost": "^0.4.9",
    "axios": "^0.21.1",
    "dotenv": "^8.2.0",
    "graphql": "^15.4.0",
    "isomorphic-fetch": "^3.0.0",
    "koa": "^2.13.1",
    "koa-router": "^8.0.8",
    "koa-session": "^6.1.0",
    "next": "^10.0.4",
    "ngrok": "^3.4.0",
    "react": "16.9.0",
    "react-apollo": "^3.1.5",
    "react-dom": "16.9.0",
    "react-html-parser": "^2.0.2",
    "react-player": "^2.7.2",
    "store-js": "^2.0.4"
  }
}
2

2 Answers

2
votes

They still have to add it to the package.

You can see the SRC code here https://github.com/Shopify/quilt/blob/master/packages/koa-shopify-graphql-proxy/src/shopify-graphql-proxy.ts and you will noticed that the version is yet not present (as of writing this answer).

You can use the unstable version if you need something for the latest API or switch to the October20 one if you are not looking for something that came recently to the API.

0
votes

Since v6.0.0 the enum has been updated to include new versions, but also the TypeScript type has been changed to a looser string union type to allow arbitrary versions, so that you can use any version even when the library lags behind.