description Shopify Storefront API (GraphQL) Overview
Shopify's Storefront API provides GraphQL access to the commerce data and operations needed to build a custom storefront. Hydrogen applications use it to retrieve products and collections, including the information needed to display merchandise and available variants. It also supports cart operations, so its role extends beyond reading a catalog. GraphQL lets developers request selected fields, while fragments help reuse query structures and variables supply changing inputs without rewriting the query.
As an official Shopify interface, it suits teams building shopping experiences outside a conventional theme. Access permissions and API versions remain part of the integration, so official support does not guarantee that every query will work unchanged. Customer access also needs care: legacy customer accounts have Storefront API operations, while Shopify's newer customer accounts use the separate Customer Account API. That distinction matters when planning authentication in Hydrogen.
help Shopify Storefront API (GraphQL) FAQ
What does the Shopify Storefront API do in a Hydrogen storefront?
The Storefront API is Shopify's GraphQL API for pulling commerce data such as products, collections, carts, and checkout-related objects into a custom storefront. In Hydrogen, it is the normal way to query Shopify data from React routes and server loaders.
Why do Shopify Storefront API examples use fragments?
Fragments let developers reuse field selections for objects like Product, MoneyV2, or Image across multiple GraphQL queries. That matters in Hydrogen because product cards, collection pages, and search results often need the same fields.
Can the Storefront API create and update carts?
Yes, Shopify's Storefront API includes cart mutations such as creating a cart and changing lines. It is not the Admin API, so it is meant for customer-facing storefront actions rather than back-office product management.
How is the Storefront API different from Shopify's Admin API?
The Storefront API is built for public storefront experiences and uses a storefront access token with customer-safe scopes. The Admin API is for store operations such as inventory, orders, and products, and should not be exposed in client-side storefront code.
explore Explore More
Similar to Shopify Storefront API (GraphQL)
compare_arrows Compare: Apollo Client See all arrow_forwardReviews & Comments
Write a Review
Be the first to review
Share your thoughts with the community and help others make better decisions.