travis-r6s / gridsome-source-shopify

Shopify source plugin for Gridsome
https://gridsome-shopify-starter.netlify.com
MIT License
16 stars 14 forks source link

Timeout Error getting Products #49

Closed jzelaya-manduka closed 3 years ago

jzelaya-manduka commented 4 years ago

Hello, I've been experiencing this issue frequently, but cannot figure out why I sometimes get this error. Unsure if this is related to Shopify or something else.

Error: Timeout: {
  "response": {
    "errors": [{
      "message": "Timeout"
    }],
    "status": 200
  },
  "request": {
    "query": "\n  query GetProducts($first: Int!, $after: String) {\n    data: products (first: $first, after: $after) {\n      pageInfo {\n        hasNextPage\n      }\n      edges {\n        cursor\n        node {\n          collections (first: $first) {\n            edges {\n              node {\n                id\n              }\n            }\n          }\n          images(first: 250) {\n            edges {\n              node {\n                id\n                altText\n                originalSrc\n              }\n            }\n          }\n          variants(first: 250) {\n            edges {\n              node {\n                availableForSale\n                compareAtPrice: compareAtPriceV2 {\n                  amount\n                  currencyCode\n                }\n                id\n                image {\n                  altText\n                  id\n                  originalSrc\n                }\n                price: priceV2 {\n                  amount\n                  currencyCode\n                }\n                selectedOptions {\n                  name\n                  value\n                }\n                sku\n                title\n                weight\n                weightUnit\n              }\n            }\n          }\n          availableForSale\n          createdAt\n          description\n          descriptionHtml\n          handle\n          id\n          onlineStoreUrl\n          options {\n            id\n            name\n            values\n          }\n          priceRange {\n            minVariantPrice {\n              amount\n              currencyCode\n            }\n            maxVariantPrice {\n              amount\n              currencyCode\n            }\n          }\n          productType\n          publishedAt\n          tags\n          title\n          updatedAt\n          vendor\n          metafields(first: 250) {\n            edges {\n              node {\n                key\n                value\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n",
    "variables": {
      "first": 100,
      "after": "eyJsYXN0X2lkIjo0MTE3ODUxNTcwMjY0LCJsYXN0X3ZhbHVlIjoiNDExNzg1MTU3MDI2NCJ9"
    }
  }
}
travis-r6s commented 4 years ago

@jesse-zm Sorry not to get back earlier, but not sure why this would happen - I should think it was something to do with Shopify. Have you been getting it since?

jzelaya-manduka commented 4 years ago

@thetre97 No worries. But yes I'm still experiencing this error. I've tried it out on two separate Shopify stores and it only occurs on the one that has the most products (a little over 300). Not sure if that has anything to do with it, but just seems strange that only one store spits out that error. I'm using the default settings for both by the way:

    {
      use: 'gridsome-source-shopify',
      options: {
        storeName: process.env.GRIDSOME_SHOPIFY_STOREFRONT,
        storefrontToken: process.env.GRIDSOME_SHOPIFY_STOREFRONT_TOKEN,
      }
    },
travis-r6s commented 4 years ago

@jesse-zm I have just released v0.2.4, and updated the HTTP client, which may help with this error. I could also add an option to update the default timeout too, should this continue to happen...