Hi all,
Been using the “collectionByHandle” graphql request to fetch products for the store of a client for quite a whole without problems. A couple weeks ago I added filters to this request, a bit like so:
products(
first: $amount
sortKey: $sortKey
reverse: $reverseKey
after: $afterCursor
filters: { price: { min: $minPrice, max: $maxPrice } }
)
This worked fine for quite a while, when making the request I pass on the values for minPrice and maxPrice, based on what the customer selected. This was online/live for about 1-2 weeks without any issues.
A couple days ago I added a filtering for product tags with the “productMetafield”. This also seemed to work fine, until I put it online on my clients website. The website worked for let’s say an hour (not sure how long exact), and then crashed with a 500 error. When I spinned up localhost, I got an internal error from Shopify. I figured I did something wrong, removed the “productMetafield” filter. Everything worked again. I ran a new build for the clients website, and we were back live.
But again, after a short while, the website crashed, 500. I spin up localhost, to spot again an internal error from Shopify. Really strange, because right now I had the price filters configuration I’ve had online for weeks, and now it did not work anymore.
If I change the variables of “$minPrice” and “$maxPrice” by actual values in graphQL, it seems to work again. If I keep the variables, but hardcode them to number values while doing the request, the query fails with;
Internal error. Looks like something went wrong on our end. Request ID: 9ea1d083-e028-47a3-ad22-50f7b2f01cc4 (include this in support requests).
I have no clue how code that worked for 1-2 weeks, all of the sudden causes an internal error. I hope someone can help me shine some light on this. Thanks!