Shopify Cannot Handle Query?

HunkyBill
Shopify Expert
4505 45 485

Simple GraphQL I think?

query($sku: String!) {
  products(first: 1, query:$sku) {
    edges {
      node {
        id
        handle
      }
    }
  }
}

 

I feed this pup "SKU:foobarbizzlybob" looking for that product with that SKU. Instead I get a spinner for 20 seconds and then Shopify pukes out an error message. I know the SKU is in the shop, and Shopify search finds it in a reasonable amount of time. What am I doing wrong here?

 "Internal error. Looks like something went wrong on our end.\nRequest ID: 2bea8300-0ebe-4fda-a602-a4ed42e8c237 (include this in support requests)."

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
CWSites
Tourist
16 0 0

Your query is a little off. I think it needs to be in this format, your query needs to be a string which is query: "sku:foobarbizzlybob". Not sure if it's the SKU being all uppercase or if it's actually coming through. Try looking at your network tab in the request to verify that it's passing what you expect?

0 Likes
HunkyBill
Shopify Expert
4505 45 485

It is true. The use of SKU: breaks Shopify whereas lowercase sku: works. Wow. Who knew such advanced software running on planet earth in 2020 could be so robust!

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
CWSites
Tourist
16 0 0

LOL well if you're up for another challenge check out the question I posted... https://community.shopify.com/c/Shopify-APIs-SDKs/graphql-response-wrong/td-p/871989

0 Likes