Shopify应用程序开发更改GraphQl API版本

发布于 2025-01-22 01:54:28 字数 439 浏览 0 评论 0原文

我正在尝试更改该应用程序正在使用的GraphQl API的版本。

设置:

  • shopify cli ver 2.15.6
  • type node.js

在代码中我看不到应用程序正在调用的URL,是否有ENV或某些服务器端 更改为最新API版本的设置?

在Next.js上,我在服务器/client.js上看到了这一点

export const createClient = (shop, accessToken) => {
  return new ApolloClient({
    uri: `https://${shop}/admin/api/2019-10/graphql.json`,

,但这在嵌入式App Bridge调用中不使用。

我想使用2022-04(最新)版本

I am trying to change the version of the graphql API the app is using.

setup:

  • shopify CLI ver 2.15.6
  • type node.js

in code I cannot see the URL the app is calling, is there an ENV or some server side
settings to change to the latest API version?

on next.js I see this on the server/client.js

export const createClient = (shop, accessToken) => {
  return new ApolloClient({
    uri: `https://${shop}/admin/api/2019-10/graphql.json`,

but this is not used in embedded app bridge calls.

I would like to use the 2022-04 (latest) version

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

守不住的情 2025-01-29 01:54:28

我认为您需要使用上下文来初始化它,根据 docs

设置上下文时,您将能够设置
Admin API您的应用将使用。

Shopify.Context.initialize({
  API_KEY,
  API_SECRET_KEY,
  SCOPES: [SCOPES],
  HOST_NAME: HOST.replace(/https:\/\//, ""),
  IS_EMBEDDED_APP: {boolean},
  API_VERSION: ApiVersion.{version} // all supported versions are available, as well as "unstable" and "unversioned"
});

I think you need to initialise it using the context, according to the docs

While setting up Context, you'll be able to set which version of the
Admin API your app will be using.

Shopify.Context.initialize({
  API_KEY,
  API_SECRET_KEY,
  SCOPES: [SCOPES],
  HOST_NAME: HOST.replace(/https:\/\//, ""),
  IS_EMBEDDED_APP: {boolean},
  API_VERSION: ApiVersion.{version} // all supported versions are available, as well as "unstable" and "unversioned"
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文