Shopify / hydrogen

Hydrogen lets you build faster headless storefronts in less time, on Shopify.
https://hydrogen.shop
MIT License
1.44k stars 274 forks source link

GraphQL Fragments / Help #857

Open benjaminsehl opened 1 year ago

benjaminsehl commented 1 year ago

We currently do things that ask for GQL, but provide no way of knowing what GQL needs to be included.

There should be an easy way (via fragments, CLI generation, maybe we even scaffold a client for you in a /lib folder for getProduct(), etc) for us to provide you with GraphQL.

This should align with what the JS API client is doing: https://github.com/Shopify/storefront-api-client-js-queries/tree/main/src/client

Ideally we could cycle back to the Rails Bullet idea where we also can look for over/under fetching and warn you.

frehner commented 1 year ago

A really easy and decent first step could be to just include an example GraphQL query on the documentation page itself. That way we provide what the query should be, but it's not part of the library itself so it still leaves the door open for us to figure things out later.