小编vis*_*nki的帖子

在 Shopify SellingPlanPricingPolicy 的联盟上执行 GraphQL 选择

我正在尝试使用 Shopify 的 Graphql API 获取联合数据,但无法找到有关在联合中选择数据的任何文档。

这是我当前的查询:

query subscriptionPlans {
  sellingPlanGroup(id: 1234) {
    id
    name
    sellingPlans(first: 1) {
      edges {
        node {
          id
          billingPolicy {
            ... on SellingPlanRecurringBillingPolicy {
              interval
              intervalCount
            }
          }
          pricingPolicies {
            on
            SellingPlanRecurringPricingPolicy {
              afterCycle
              adjustmentType
              adjustmentValue {
                on
                SellingPlanPricingPolicyPercentageValue {
                  percentage
                }
                on
                MoneyV2 {
                  amount
                  currencyCode
                }
              }
            }
          }
        }
      }
    }
  }
}

Run Code Online (Sandbox Code Playgroud)

在这种情况下我能够检索 sellPlans。当我到达 SellingPlanPricingPolicy 部分时,我遇到了问题。我收到错误:

Selections can't be made directly on unions (see selections on SellingPlanPricingPolicy)
Run Code Online (Sandbox Code Playgroud)

但是,我无法找到任何有关使用以下文档进行选择的文档: https: //shopify.dev/docs/admin-api/graphql/reference/products-and-collections/ sellplanpricingpoli …

shopify graphql

3
推荐指数
1
解决办法
2534
查看次数

标签 统计

graphql ×1

shopify ×1