Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hey everyone, could somebody point me in the direction of where I could find a list of types for storefront api responses? Currently following along the hydrogen tutorial but it's not written in typescript... Thanks!
I know this is an old one, but I found it when searching for this answer myself, so wanted to leave an answer now that I've found one.
Each type returned from the Storefront API has a corresponding Typescript type (which is already included if you chose Typescript when creating your Hydrogen project). For example, if you're retrieving `collections` from the API, you can see in the docs here, that returns a `CollectionConnection`. To use that type in your Typescript, you add this import to the top of your TS file:
import type {CollectionConnection} from '@shopify/hydrogen-react/storefront-api-types';
You can now use this type in your TS code and get intellisense.