Liquid、JavaScriptなどに関する質問
同じ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 } } } }
Shopify アカデミーの学習パスと認定スキルバッジExpanding Your Shopify Business Internationallyを活用して、国際的にビジネ...
By Shopify Feb 7, 2025Shopify アカデミーの学習パスB2B on Shopify:立ち上げとカスタマイズで卸売販売に進出しましょう。これら3つの無料コースは、ShopifyストアでB2B機能...
By Shopify Jan 31, 2025サポートの選択肢が増えていく中、最適となる選択の判断が難しくなっているかと存じます。今回は問題の解決に最適となるサポートの選択方法を、紹介させて頂きます。 選択肢のご紹介...
By Mirai Oct 6, 2024