Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

ECONNRESET

ECONNRESET

dugiwarc
Shopify Partner
6 0 1

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
              }
            }
          }
        }
      }
    }

 

Replies 5 (5)

SBD_
Shopify Staff
1831 273 423

Hey @dugiwarc 

 

Is this via Node? Does the request work when sent from, say, Insomnia or Curl?

Scott | Developer Advocate @ Shopify 

dugiwarc
Shopify Partner
6 0 1

Hey @SBD_ ,

I have tried both axios in node and Postman 🙂

 

SBD_
Shopify Staff
1831 273 423

Strange! Thanks - can you please DM me example failing query and store url?

Scott | Developer Advocate @ Shopify 

dugiwarc
Shopify Partner
6 0 1

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"
}↵"

 

 

SBD_
Shopify Staff
1831 273 423

Thanks @dugiwarc 

 

I'm unable to replicate so far. Are you able to try installing + sending it with this app?

Scott | Developer Advocate @ Shopify