我正在为我的 Shopify 应用设置应用卸载 webhook。我在 Shopify Developer 中的应用设置为最新的 API (2021-01)。
但是,当我注册我的 webhook 时,没有 ApiVersion.January21 选项。当我将其设置为 January21 时,我得到以下信息:
错误:https://test-sonder.myshopify.com/admin/api/undefined/graphql.json 处的 JSON 响应正文无效 原因:JSON 输入意外结束。
这是我的 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
});
我的 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"
}
}