What's your biggest current challenge? Have your say in Community Polls along the right column.
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.

Internal Error When Querying Products by Variant Metafield

Internal Error When Querying Products by Variant Metafield

tobias1
Visitor
2 0 0

Dear Shopify Support,

I am encountering an internal error when attempting to query products by a variant metafield using the following GraphQL query:

 

{
  products: search(
    first: 10
    query: "example"
    unavailableProducts: SHOW
    productFilters: [{variantMetafield: {namespace: "custom", key: "releasemonth", value: "2022-1"}}]
  ) {
    nodes {
      ... on Product {
        id
        title
        handle
        vendor
        variants(first: 1, sortKey: RELEVANCE) {
          nodes {
            id
            title
            image {
              id
              url
              altText
              width
              height
            }
          }
        }
      }
    }
  }
}

I am expecting to see a list of products matching the query including the variant, that matches best with the varaiant metafield productFilter. Instead I am getting an internal error:

Internal error. Looks like something went wrong on our end.
Request ID: c18c13e8-8123-4a89-9044-1afc4d32c6d1-1721938750 (include this in support requests).

Notably, this error does not occur when i choose a query value, that returns an empty result.

Any guidance on what might be causing the internal error and how to fix it would be greatly appreciated.

Thank you for your support.

Best regards,

Tobias

 

Replies 3 (3)

Liam
Community Manager
3108 344 895

Hi Tobias,

 

Are you still seeing this error? If so can you share a recent Request ID?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

tobias1
Visitor
2 0 0

Hi Liam,

 

thank you for your response. As a temporary solution i am currently request all variants without sortKey and filter it on the client side.

when i reintroduced the sortKey: RELEVANCE, i got an error with the following request ID:

Request ID: 66ec27a4-5ac8-4112-b111-809af04d5dfc-1722270136

Liam
Community Manager
3108 344 895

Hi Tobias - I can't see much more on our logs other than the GraphqlResponder is failing - can you continue with your workaround to request all variants without sortKey and filter on the client side? 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog