【问题标题】:Shopify GraphQL API: Editing an orderShopify GraphQL API:编辑订单
【发布时间】:2019-10-21 12:44:57
【问题描述】:

我正在尝试使用 Shopify GraphQL API 编辑已下订单。 我获得了获取商店信息的有效结果,因此连接到 shopify 没有问题。但是在创建beginEdit 突变时,我得到了响应

Field 'orderEditBegin' doesn't exist on type 'Mutation'.

我使用的PHP库是this,使用的代码也是基于这个库。使用的凭据来自私人 Shopify 应用程序。我也尝试过使用另一个PHP library,但得到了相同的响应。

以下是我尝试过的,

$config = array(
   'ShopUrl' => '*******.myshopify.com',
   'ApiKey' => '********************',
   'SharedSecret' => '********************',
   'AccessToken' => '********************'
);

$shopify = PHPShopify\ShopifySDK::config($config);

$graphQL = <<<Query
        mutation beginEdit{
 orderEditBegin(id: "gid://shopify/Order/1234"){
    calculatedOrder{
      id
    }
  }
}
Query;

var_dump($shopify->GraphQL->post($graphQL));

我在这里做错了什么?

【问题讨论】:

    标签: php api graphql shopify


    【解决方案1】:

    orderEditBegin目前处于不稳定版本,仅在预览版开发者商店中提供。更多信息:https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/ordereditbegin

    如果您不使用此类商店,请使用不同的 GraphQL 请求。

    例如:https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/orderupdate

    【讨论】:

    猜你喜欢
    • 2018-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多