search
Get Started
search
Shopify Storefront API (GraphQL) - Shopify Storefront API
zoom_in Click to enlarge

Shopify Storefront API (GraphQL)

description Shopify Storefront API (GraphQL) Overview

This is the foundational, official method for fetching product, collection, and customer data directly from Shopify within Hydrogen. While it's the source, mastering its specific query patterns (like using fragments and variables) is key. It is the most reliable starting point because it is guaranteed to work with the current Shopify platform structure, minimizing integration risk for core product data.

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.

Reviews & Comments

Write a Review

rate_review

Be the first to review

Share your thoughts with the community and help others make better decisions.

Save to your list

Save your favorites and follow how their scores change over time.

Save favorites
Track changes
Compare scores

Already have an account? Sign in

Compare Items

See how they stack up against each other

Comparing
VS
Select 1 more item to compare