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.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Storefront GQL API collectionByHandle throwing internal error

Storefront GQL API collectionByHandle throwing internal error

saylau
Visitor
3 0 0

Hi!
I'm facing an error with Storefront GQL API collectionByHandle method, this request were working before, but now it is throwing following error:

[{'message': 'Internal error. Looks like something went wrong on our end.\\nRequest ID: ff0c34da-ee73-4b98-b0e9-2687619ea4c6 (include this in support requests).', 'extensions': {'code': 'INTERNAL_SERVER_ERROR', 'requestId': 'ff0c34da-ee73-4b98-b0e9-2687619ea4c6'}}]

That is the example of the query I'm making :

query MyQuery {
  collectionByHandle(handle: "frontpage") {
    id
    title
    handle
    products(sortKey: BEST_SELLING, reverse: false, first: 10) {
      edges {
        cursor
        node {
          id
          tags
          title
          handle
          totalInventory
          options {
            name
            values
          }
          images(first: 1) {
            edges {
              node {
                url(transform: {maxHeight: 500, maxWidth: 500})
              }
            }
          }
          priceRange {
            maxVariantPrice {
              amount
              currencyCode
            }
            minVariantPrice {
              amount
              currencyCode
            }
          }
          variants(first: 10) {
            edges {
              node {
                id
                sku
                title
                availableForSale
                image {
                  id
                  url(transform: {maxHeight: 500, maxWidth: 500})
                }
                selectedOptions {
                  name
                  value
                }
                compareAtPrice {
                  amount
                  currencyCode
                }
                price {
                  amount
                  currencyCode
                }
                quantityAvailable
              }
            }
          }
          compareAtPriceRange {
            maxVariantPrice {
              amount
              currencyCode
            }
            minVariantPrice {
              amount
              currencyCode
            }
          }
        }
      }
      pageInfo {
        hasNextPage
        hasPreviousPage
      }
    }
  }
}

Request ID for reference: ff0c34da-ee73-4b98-b0e9-2687619ea4c6

Replies 4 (4)

ShopifyDevSup
Shopify Staff
1453 239 535

Hey @saylau

 

Thanks for sharing that. Testing your exact query here it is working for me. 

 

What I would recommend is to do some further troubleshooting. First, make sure that the products and collections are published and available. 

 

From there, I would work at simplifying the query starting with a single field and slowly add in the additional fields you need. That will help narrow down the specific part of the query that is returning the error. 

 

If the issue is persisting after that, reach out to our support teams by logging in to the help center so we can take a closer look at your specific store details and requests to narrow down the issue. 

 

Hope that helps, 

 

- Kyle G. 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

saylau
Visitor
3 0 0

Hi, Kyle!

1. All products and collections, are published and available. Besides if some are not, shouldn't it just leave that out of response, and show all other contents

2. For me its not working even like this:

{
  collectionByHandle(handle: "") {
    handle
  }
}

 or like this

{
  collectionByHandle(handle: "some-handle") {
    id
  }
}

this all gives the same response

Sure I'll go with this to support
Thanks for your reply!

saylau
Visitor
3 0 0

Also I facing this issue with many stores
Can you point me in right direction, should i contact support through a store account?

ShopifyDevSup
Shopify Staff
1453 239 535

Hey @saylau , if you have a partner account with collaborator access and the appropriate permissions to the stores experiencing this, then Partner Support would be the best place to reach out, otherwise, reaching out logged in to one of the stores experiencing this will work as well. 

 

Thanks, 

 

- Kyle G. 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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