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"
}
}