A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
The query below works perfectly fine with an estimated cost of 702, but an actual of 59 that I send to the graphql.json endpoint.
However if I add a third productVariant, I get an ECONNRESET error, where the cost is also 702 which is very well below the limit.
Why is that ?
query GetProductVariants($productVariantId0: ID!, $productVariantId1: ID!) { PRODUCT_0: productVariant(id: $productVariantId0) { ...ProductVariantFields } PRODUCT_1: productVariant(id: $productVariantId1) { ...ProductVariantFields } } fragment ProductVariantFields on ProductVariant { price sku id inventoryQuantity inventoryManagement inventoryPolicy inventoryItem { id inventoryLevels(first: 1) { edges { node { location { id } } } } } }
Hey @dugiwarc
Is this via Node? Does the request work when sent from, say, Insomnia or Curl?
Scott | Developer Advocate @ Shopify
Strange! Thanks - can you please DM me example failing query and store url?
Scott | Developer Advocate @ Shopify
Here's it is ! 🙂
https://salonkeee.myshopify.com/admin/api/2022-10/graphql.json
query: "query GetProductVariants($productVariantId0: ID!, $productVariantId1: ID!, $productVariantId2: ID!) {
PRODUCT_0: productVariant(id: $productVariantId0) {
...ProductVariantFields
}
PRODUCT_1: productVariant(id: $productVariantId1) {
...ProductVariantFields
}
PRODUCT_2: productVariant(id: $productVariantId2) {
...ProductVariantFields
}
}
fragment ProductVariantFields on ProductVariant {
price
sku
id
inventoryQuantity
inventoryManagement
inventoryPolicy
inventoryItem {
id
inventoryLevels(first: 1) {
edges {
node {
location {
id
}
}
}
}
}
}"
variables: "{
"productVariantId0": "gid://shopify/ProductVariant/47243262689626",
"productVariantId1": "gid://shopify/ProductVariant/47243263213914",
"productVariantId2": "gid://shopify/ProductVariant/47243262394714"
}↵"