FROM CACHE - jp_header

同じGraphQLのQueryの場合でも通常QueryとbulkOperationRunQueryとで実行結果が異なる

同じGraphQLのQueryの場合でも通常QueryとbulkOperationRunQueryとで実行結果が異なる

otsunaccre
Shopify Partner
12 0 0

同じGraphQLのQueryの場合でも、通常QueryとbulkOperationRunQueryとで実行結果が異なります。
添付ファイルのように、通常Queryの場合はproductsの下の階層にimagesが作成されますが、bulkOperationRunQueryの場合はproductsと同じ階層にimagesが作成されているようです。

 

bulkOperationRunQueryの実行結果でも、通常Queryのように、productsの下の階層にimagesが作成されるようにしたいのですが、GraphQLのQueryの書き方などで対応できますでしょうか??

宜しくお願いいたします。

▼bulkOperationRunQuery

mutation {
  bulkOperationRunQuery(
    query: """
    {
      products {
        edges {
          node {
            id
            legacyResourceId
            images {
              edges {
                node {
                  altText
                  height
                  id
                  url
                  width
                }
              }
            }
          }
        }
      }
    }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

bulkOperationRunQueryの実行結果

{
    "id": "gid://shopify/Product/8635658731801",
    "legacyResourceId": "8635658731801"
}
{
    "altText": "",
    "height": 1808,
    "id": "gid://shopify/ProductImage/42465427259673",
    "url": "https://cdn.shopify.com/s/files/1/0818/6200/0921/files/Soap-Image1.png?v=1693360230",
    "width": 1800,
    "__parentId": "gid://shopify/Product/8635658731801"
}
{
    "altText": "",
    "height": 1769,
    "id": "gid://shopify/ProductImage/42465427521817",
    "url": "https://cdn.shopify.com/s/files/1/0818/6200/0921/files/Soap-Image2.png?v=1693360231",
    "width": 1800,
    "__parentId": "gid://shopify/Product/8635658731801"
}
{
    "altText": "",
    "height": 1769,
    "id": "gid://shopify/ProductImage/42465427554585",
    "url": "https://cdn.shopify.com/s/files/1/0818/6200/0921/files/Soap-Image3.png?v=1693360231",
    "width": 1800,
    "__parentId": "gid://shopify/Product/8635658731801"
}
{
    "altText": "",
    "height": 1769,
    "id": "gid://shopify/ProductImage/42465427489049",
    "url": "https://cdn.shopify.com/s/files/1/0818/6200/0921/files/Soap-Image4.png?v=1693360231",
    "width": 1800,
    "__parentId": "gid://shopify/Product/8635658731801"
}
{
    "altText": "",
    "height": 1769,
    "id": "gid://shopify/ProductImage/42465427423513",
    "url": "https://cdn.shopify.com/s/files/1/0818/6200/0921/files/Soap-Image5.png?v=1693360230",
    "width": 1800,
    "__parentId": "gid://shopify/Product/8635658731801"
}


▼通常Query

query {
    products(first: 1) {
        edges {
            node {
                id
                legacyResourceId
                images(first: 1) {
                    edges {
                        node {
                            altText
                            height
                            id
                            url
                            width
                        }
                    }
                }
            }
        }
    }
}

▼通常Queryの実行結果

{
    "data": {
        "products": {
            "edges": [
                {
                    "node": {
                        "id": "gid://shopify/Product/8635658731801",
                        "legacyResourceId": "8635658731801",
                        "images": {
                            "edges": [
                                {
                                    "node": {
                                        "altText": "",
                                        "height": 1808,
                                        "id": "gid://shopify/ProductImage/42465427259673",
                                        "url": "https://cdn.shopify.com/s/files/1/0818/6200/0921/files/Soap-Image1.png?v=1693360230",
                                        "width": 1800
                                    }
                                }
                            ]
                        }
                    }
                }
            ]
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 6,
            "actualQueryCost": 6,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 994,
                "restoreRate": 50.0
            }
        }
    }
}

 

0件の返信0