Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello everyone,
I am currently facing an issue with accessing my store's collections through the Storefront API. Despite ensuring that my collections are published on all sales channels and granting Product and Collection API permission to my headless storefront, my GraphQL query returns null. I have been trying to troubleshoot this problem without success. Also, I am on a development store.
I would greatly appreciate any assistance or guidance that the community can provide in resolving this issue.
Here are the queries I have been using:
By id
query getSingleCollection($id: ID!){ collection(id: $id){ products(first: 2){ edges { node { id } } } } }
By handle
query getSingleCollection($handle: String!){ collectionByHandle(handle: $handle){ products(first: 2){ edges { node { id } } } } }
Response -
{ "data": { "collection": null }, "extensions": { "cost": { "requestedQueryCost": 5, "actualQueryCost": 1, "throttleStatus": { "maximumAvailable": 1000, "currentlyAvailable": 956, "restoreRate": 50 } } } }
Thank you in advance for your help!
Nico
did you find the solution ?