Query Root
The entry point for all Storefront API queries. Provides access to shop resources including products, collections, carts, and customer data, as well as content like articles and pages. This query acts as the public, top-level type from which all queries must start.
Use individual queries like product or collection to fetch specific resources by ID or handle. Use plural queries like products or collections to retrieve paginated lists with optional filtering and sorting. The search and queries enable storefront search functionality.
Explore queries interactively with the GraphiQL explorer and sample query kit.
Anchor to FieldsFields
- article (Article)
- articles (ArticleConnection!)
- blog (Blog)
- blogs (BlogConnection!)
- cart (Cart)
- collection (Collection)
- collections (CollectionConnection!)
- customer (Customer)
- localization (Localization!)
- locations (LocationConnection!)
- menu (Menu)
- metaobject (Metaobject)
- metaobjects (MetaobjectConnection!)
- node (Node)
- nodes ([Node]!)
- page (Page)
- pages (PageConnection!)
- paymentSettings (PaymentSettings!)
- predictiveSearch (PredictiveSearchResult)
- product (Product)
- productRecommendations ([Product!])
- products (ProductConnection!)
- productTags (StringConnection!)
- productTypes (StringConnection!)
- publicApiVersions ([ApiVersion!]!)
- search (SearchResultItemConnection!)
- shop (Shop!)
- sitemap (Sitemap!)
- urlRedirects (UrlRedirectConnection!)
- Anchor to articlearticle•Article
Returns an
Articleby its ID. Each article belongs to aBlogand includes content in both plain text and HTML formats,information,Commentobjects, tags, anddata.- •ID!required
The ID of the
Article.
Arguments
- •ID!
- Anchor to articlesarticles•Article
Connection! non-null Returns a paginated list of
Articleobjects from the shop'sBlogobjects. Each article is a blog post containing content, author information, tags, and optional images.Use the
queryargument to filter results by author, blog title, tags, or date fields. Sort results using theargument and reverse them with thereverseargument.- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Article
Key Sort Keys Default:ID Sort the underlying list by the given key.
- Anchor to queryquery•String
Apply one or multiple filters to the query. Refer to the detailed search syntax for more information about using filters.
Arguments
- Anchor to blogblog•Blog
Retrieves a
Blogby its handle or ID. A blog organizesArticleobjects for the online store and includes author information,settings, and customMetafieldobjects.- Anchor to handlehandle•String
The handle of the
Blog.- •ID
The ID of the
Blog.
Arguments
- Anchor to blogsblogs•Blog
Connection! non-null Returns a paginated list of the shop's
Blogobjects. Each blog serves as a container forArticleobjects.- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Blog
Key Sort Keys Default:ID Sort the underlying list by the given key.
- Anchor to queryquery•String
Apply one or multiple filters to the query. Refer to the detailed search syntax for more information about using filters.
Arguments
- Anchor to cartcart•Cart
Returns a
Cartby its ID. The cart contains the merchandise lines a buyer intends to purchase, along with estimated costs, applied discounts, gift cards, and delivery options.Use the
field to redirect buyers to Shopify's web checkout when they're ready to complete their purchase. For more information, refer to Manage a cart with the Storefront API.- •ID!required
The ID of the cart.
Arguments
- •ID!
- Anchor to collectioncollection•Collection
Retrieves a single
Collectionby its ID or handle. Use theproductsfield to access items in the collection.- •ID
The ID of the
Collection.- Anchor to handlehandle•String
The handle of the
Collection.
Arguments
- Anchor to collectionscollections•Collection
Connection! non-null Returns a paginated list of the shop's collections. Each
Collectionobject includes a nested connection to its products.- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Collection
Key Sort Keys Default:ID Sort the underlying list by the given key.
- Anchor to queryquery•String
Apply one or multiple filters to the query. Refer to the detailed search syntax for more information about using filters.
Arguments
- Anchor to customercustomer•CustomerToken access required
Retrieves the
Customerassociated with the provided access token. Use themutation to obtain an access token using legacy customer account authentication (email and password).The returned customer includes data such as contact information, addresses, orders, and custom data associated with the customer.
- Anchor to customerAccessTokencustomer•String!
Access Token required The customer access token.
Arguments
- Anchor to localizationlocalization•Localization!non-null
Returns the shop's localization settings. Use this query to build country and language selectors for your storefront.
The
countryandlanguagefields reflect the active localized experience. To change the context, use thedirective with your desired country or language code.- Anchor to locationslocations•Location
Connection! non-null Returns shop locations that support in-store pickup. Use the
nearargument withto sort results by proximity to the customer's location.When sorting by distance, set
toand provide coordinates using thenearargument.Learn more about supporting local pickup on storefronts.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Location
Key Sort Keys Default:ID Sort the underlying list by the given key.
- Anchor to nearnear•Geo
Coordinate Input Used to sort results based on proximity to the provided location.
Arguments
- •MenuToken access required
Retrieves a
Menuby its handle. Menus are hierarchical navigation structures that merchants configure for their storefront, such as header and footer navigation.Each menu contains
objects that can nest up to three levels deep, with each item linking to collections, products, pages, blogs, or external URLs.- •String!required
The navigation menu's handle.
Arguments
- •String!
- Anchor to metaobjectmetaobject•MetaobjectToken access required
Retrieves a single
Metaobjectby either itsor itshandle.NoteWhen using the handle, you must also provide the metaobject type because handles are only unique within a type.
Note:When using the handle, you must also provide the metaobject type because handles are only unique within a type.
Note: When using the handle, you must also provide the metaobject type because handles are only unique within a type.
- •ID
The ID of the metaobject.
- Anchor to handlehandle•Metaobject
Handle Input The handle and type of the metaobject.
Arguments
- Anchor to metaobjectsmetaobjects•Metaobject
Connection! non-null Token access required Returns a paginated list of
Metaobjectentries for a specific type. Metaobjects are custom data structures that extend Shopify's data model with merchant-defined or app-defined content like size charts, product highlights, or custom sections.The required
typeargument specifies which metaobject type to retrieve. You can sort results byidorusing theargument.- Anchor to typetype•String!required
The type of metaobject to retrieve.
- Anchor to sortKeysort•String
Key The key of a field to sort with. Supports "id" and "updated_at".
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to nodenode•Node
Retrieves any object that implements the
Nodeinterface by its globally-unique ID. Use inline fragments to access type-specific fields on the returned object.This query follows the Relay specification and is commonly used for refetching objects when you have their ID but need updated data.
- •ID!required
The ID of the Node to return.
Arguments
- •ID!
- Anchor to nodesnodes•[Node]!non-null
Retrieves multiple objects by their global IDs in a single request. Any object that implements the
Nodeinterface can be fetched, including products, collections, and pages.Use inline fragments to access type-specific fields on the returned objects. The input accepts up to 250 IDs.
- •[ID!]!required
The IDs of the Nodes to return.
The input must not contain more than
250values.
Arguments
- •[ID!]!
- Anchor to pagepage•Page
Retrieves a
Pageby itshandleorid. Pages are static content pages that merchants display outside their product catalog, such as "About Us," "Contact," or policy pages.The returned page includes information such as the HTML body content,
information, and any associatedMetafieldobjects.- Anchor to handlehandle•String
The handle of the
Page.- •ID
The ID of the
Page.
Arguments
- Anchor to pagespages•Page
Connection! non-null Returns a paginated list of the shop's content pages. Pages are custom HTML content like "About Us", "Contact", or policy information that merchants display outside their product catalog.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Page
Key Sort Keys Default:ID Sort the underlying list by the given key.
- Anchor to queryquery•String
Apply one or multiple filters to the query. Refer to the detailed search syntax for more information about using filters.
Arguments
- Anchor to paymentSettingspayment•Payment
Settings Settings! non-null Settings related to payments.
- Anchor to predictiveSearchpredictive•Predictive
Search Search Result Returns suggested results as customers type in a search field, enabling type-ahead search experiences. The query matches products, collections, pages, and articles based on partial search terms, and also provides search query suggestions to help customers refine their search.
You can filter results by resource type and limit the quantity. The
argument controls whether limits apply across all result types or per type. Useto control how out-of-stock products appear in results.- Anchor to limitlimit•Int
Limits the number of results based on
. The value can range from 1 to 10, and the default is 10.- Anchor to limitScopelimit•Predictive
Scope Search Limit Scope Decides the distribution of results.
- Anchor to queryquery•String!required
The search query.
- Anchor to searchableFieldssearchable•[Searchable
Fields Field!] Specifies the list of resource fields to use for search. The default fields searched on are TITLE, PRODUCT_TYPE, VARIANT_TITLE, and VENDOR. For the best search experience, you should search on the default field set.
The input must not contain more than
250values.- Anchor to typestypes•[Predictive
Search Type!] The types of resources to search for.
The input must not contain more than
250values.- •Search
Unavailable Products Type Specifies how unavailable products are displayed in the search results.
Arguments
- Anchor to productproduct•Product
Retrieves a single
Productby its ID or handle. Use this query to build product detail pages, access variant and pricing information, or fetch product media and metafields. See some examples of querying products.- •ID
The ID of the
Product.- Anchor to handlehandle•String
The handle of the
Product.
Arguments
- Anchor to productRecommendationsproduct•[Product!]
Recommendations Returns recommended products for a given product, identified by either ID or handle. Use the
intentargument to control the recommendation strategy.Shopify auto-generates related recommendations based on sales data, product descriptions, and collection relationships. Complementary recommendations require manual configuration through the Shopify Search & Discovery app. Returns up to ten
Productobjects.- Anchor to productIdproduct•ID
Id The id of the product.
- Anchor to productHandleproduct•String
Handle The handle of the product.
- Anchor to intentintent•Product
Recommendation Intent Default:RELATED The recommendation intent that is used to generate product recommendations. You can use intent to generate product recommendations on various pages across the channels, according to different strategies.
Arguments
- Anchor to productsproducts•Product
Connection! non-null Returns a paginated list of the shop's products.
For full-text storefront search, use the
searchquery instead.- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Product
Key Sort Keys Default:ID Sort the underlying list by the given key.
- Anchor to queryquery•String
You can apply one or multiple filters to a query. Learn more about Shopify API search syntax.
- Anchor to available_for_sale•
Filter by products that have at least one product variant available for sale.
- Anchor to created_at•
Filter by the date and time when the product was created.
created_at:>'2020-10-21T23:39:20Z'created_at:<nowcreated_at:<=2024- Anchor to product_type•
Filter by a comma-separated list of product types.
product_type:snowboard- Anchor to tag_not•
Filter by products that don't have the specified product tags.
tag_not:my_tag- Anchor to updated_at•
Filter by the date and time when the product was last updated.
updated_at:>'2020-10-21T23:39:20Z'updated_at:<nowupdated_at:<=2024- Anchor to variants.price•
Filter by the price of the product's variants.
Example:
Example:
Example:
Example:
Arguments
- Anchor to productTagsproduct•String
Tags Connection! non-null Token access required Returns a paginated list of all tags that have been added to products in the shop. Useful for building tag-based product filtering or navigation in a storefront.
- Anchor to firstfirst•Int!required
Returns up to the first
nelements from the list.
Arguments
- Anchor to productTypesproduct•String
Types Connection! non-null Returns a list of product types from the shop's
Productobjects that are published to your app. Use this query to build filtering interfaces or navigation menus based on product categorization.- Anchor to firstfirst•Int!required
Returns up to the first
nelements from the list.
Arguments
- Anchor to publicApiVersionspublic•[Api
Api Versions Version!]! non-null Returns all public Storefront API versions, including supported, release candidate, and unstable versions.
- Anchor to searchsearch•Search
Result Item Connection! non-null Returns paginated search results for
Product,Page, andArticleresources based on a query string. Results are sorted by relevance by default.The response includes the total result count and available product filters for building faceted search interfaces. Use the
prefixargument to enable partial word matching on the last search term, allowing queries like "winter snow" to match "snowboard" or "snowshoe".- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Search
Key Sort Keys Default:RELEVANCE Sort the underlying list by the given key.
- Anchor to queryquery•String!required
The search query.
- Anchor to prefixprefix•Search
Prefix Query Type Specifies whether to perform a partial word match on the last search term.
- Anchor to productFiltersproduct•[Product
Filters Filter!] Returns a subset of products matching all product filters.
The input must not contain more than
250values.- Anchor to typestypes•[Search
Type!] The types of resources to search for.
The input must not contain more than
250values.- •Search
Unavailable Products Type Specifies how unavailable products or variants are displayed in the search results.
Arguments
- Anchor to shopshop•Shop!non-null
Returns the
Shopassociated with the storefront access token. TheShopobject provides general store information such as the shop name, description, and primary domain.Use this query to access data like store policies,
,Brandconfiguration, and shipping destinations. It also exposesandoptions for customer accounts.- Anchor to sitemapsitemap•Sitemap!non-null
Returns sitemap data for a specific resource type, enabling headless storefronts to generate XML sitemaps for search engine optimization. The query provides a page count and paginated access to resources like
Product,Collection,Page, andBlogobjects.When paginating through resources, the number of items per page varies from 0 to 250, and empty pages can occur without indicating the end of results. Always check
to determine if more pages are available.- Anchor to typetype•Sitemap
Type! required The type of the resource for the sitemap.
Arguments
- Anchor to urlRedirectsurl•Url
Redirects Redirect Connection! non-null Returns a paginated list of
objects configured for the shop. Each redirect maps an old path to a target location.- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to queryquery•String
Apply one or multiple filters to the query. Refer to the detailed search syntax for more information about using filters.
Arguments
Deprecated fields
- blogByHandle (Blog): deprecated
- collectionByHandle (Collection): deprecated
- pageByHandle (Page): deprecated
- productByHandle (Product): deprecated
- Anchor to blogByHandleblog•Blog
By Handle Deprecated - Anchor to handlehandle•String!required
The handle of the blog.
Arguments
- Anchor to collectionByHandlecollection•Collection
By Handle Deprecated - Anchor to handlehandle•String!required
The handle of the collection.
Arguments
- Anchor to pageByHandlepage•Page
By Handle Deprecated - Anchor to handlehandle•String!required
The handle of the page.
Arguments
- Anchor to productByHandleproduct•Product
By Handle Deprecated - Anchor to handlehandle•String!required
A unique, human-readable string of the product's title. A handle can contain letters, hyphens (
-), and numbers, but no spaces. The handle is used in the online store URL for the product.
Arguments