Storefront GraphQL
Objects
Every object type the storefront graph returns, and its fields.
Collection
| Field | Type | Description |
|---|---|---|
description | String | |
handle | String! | |
id | ID! | |
title | String! |
Metafield
A custom field this shop defined, and this product’s answer.
| Field | Type | Description |
|---|---|---|
key | String! | |
label | String! | The merchant’s own name for the field. What a page should print. |
namespace | String! | |
type | String! | One of single_line_text, multi_line_text, integer, decimal, boolean, date, url. |
value | String! | The value as text. Lists are joined; use values to get them apart. |
values | [String!] | The entries, for a list field. Null when the field holds a single value. |
Money
An amount in the minor unit of a currency.
| Field | Type | Description |
|---|---|---|
amount | MinorUnits! | |
compareAtAmount | MinorUnits | What this used to cost, when the merchant has set one. |
currency | CurrencyCode! | |
listAmount | MinorUnits | The shop's public price, when an agreement means this viewer pays less. Null for everybody else. Anything republishing a price should send this rather than amount, which is one buyer's negotiated figure. |
PageInfo
| Field | Type | Description |
|---|---|---|
endCursor | String | |
hasNextPage | Boolean! | |
hasPreviousPage | Boolean! | |
startCursor | String | |
truncated | Boolean! | True when this listing holds products no cursor can reach, so a client can say so rather than ending the list in silence. |
PriceBreak
What buying more costs, under this viewer's agreement.
| Field | Type | Description |
|---|---|---|
amount | MinorUnits! | |
minQuantity | Int! | The quantity at which this price starts applying. |
Product
A product as a shopper sees it. Drafts and archived products are not reachable.
| Field | Type | Description |
|---|---|---|
description | String | The enriched copy where it exists, the merchant’s own where it does not. Enriched copy wins because it was written for a shopper. |
faqs | [ProductFaq!]! | |
fromPrice | Money | The lowest live price across variants. Null when nothing is purchasable. |
handle | String! | |
id | ID! | |
images | [ProductImage!]! | |
inStock | Boolean! | |
metafields(keys) | [Metafield!]! | Custom fields, by name. Address one as "namespace.key", or by its flat key where the namespace is "custom". |
productType | String | |
seoDescription | String | |
seoTitle | String | |
summary | String | A short line that reads better on a card than a full description. |
tags | [String!]! | |
title | String! | |
variants | [ProductVariant!]! | |
vendor | String |
metafields takes:
| Argument | Type | Description |
|---|---|---|
keys | [String!]! | Up to 25 field names. A name the shop has not defined is left out. |
ProductFaq
A question shoppers ask about this product, and its answer.
| Field | Type | Description |
|---|---|---|
answer | String! | |
question | String! |
ProductImage
| Field | Type | Description |
|---|---|---|
alt | String | |
position | Int! | |
url | String! |
ProductVariant
| Field | Type | Description |
|---|---|---|
available | Int! | Units that can be bought right now, net of what other baskets are holding. |
id | ID! | |
image | VariantImage | The picture to show when this variant is picked. Its own where the merchant photographed it, and the product’s first otherwise, so a picker never goes blank. Null only for a product with no pictures at all. |
inStock | Boolean! | |
options | [SelectedOption!]! | The option values that identify this variant, for a picker. |
orderIncrement | Int | The step a quantity has to land on, counted from orderMinimum. Null for no rule. |
orderMaximum | Int | The most one buyer may take at once. Null for no rule. |
orderMinimum | Int | The fewest the shop will sell at once. Null for no rule. |
price | Money | The live price, read from Postgres in this request. Null when this variant is not purchasable. |
priceBreaks | [PriceBreak!]! | What buying more costs. Empty unless an agreement prices this viewer. |
sku | String | |
title | String! |
SelectedOption
| Field | Type | Description |
|---|---|---|
name | String! | |
value | String! |
Shop
| Field | Type | Description |
|---|---|---|
collection(handle) | Collection | |
collections | [Collection!]! | |
product(handle) | Product | One product by handle. Null for a draft, an archived one, or nothing at all. |
products(after, before, collection, first, last) | ShopProductsConnection! | Published products, in a stable order that survives the catalogue changing. |
collection takes:
| Argument | Type | Description |
|---|---|---|
handle | String! |
product takes:
| Argument | Type | Description |
|---|---|---|
handle | String! |
products takes:
| Argument | Type | Description |
|---|---|---|
after | String | |
before | String | |
collection | String | Limit to one collection, by its handle. |
first | Int | |
last | Int |
ShopProductsConnection
| Field | Type | Description |
|---|---|---|
edges | [ShopProductsConnectionEdge!]! | |
pageInfo | PageInfo! |
ShopProductsConnectionEdge
| Field | Type | Description |
|---|---|---|
cursor | String! | |
node | Product! |
VariantImage
| Field | Type | Description |
|---|---|---|
alt | String | |
url | String! |