Collection by handle is broken for collection graphql

collection by handle is broken for

Looks like there is a shopify bug where collection by handle is broken using the new api:

query getCollectionByHandle($handle: String!) {
  collection(handle: $handle) {
    title
  }
}

and I have to use the deprecated collectionByHandle api instead

Are you using the correct version of the library?
I tried “version 2024.10.3” and “version 2025.1.2” in the hydrogen project, and both returned correct responses.

If you try the latest version and the result is still the same, I think only the Shopify team can resolve this.

I noticed something when looking at the tags on your post.

Your tags point to the “Graphql Admin api”, but the document URL in the post points to the “Graphql Storefront api”.

As I said earlier, it works fine with the storefront api.
However, it seems that the “handle” argument is not supported by the admin api.

And just like the storefront api, collectionByHandle is deprecated in the latest stable version, and collectionByIdentifier will be available from “version 2025.4 (candidate)”.

I have checked the query you provided and got the result using the graphQL admin App.

Please see the screenshot:

If you are used the query for admin api call you will get error.

1 Like