Skip to content
Select theme
Light
Dark
Auto
Select language
English
فارسی

Queries

Everything a storefront can read.

Shop-scoped: the token names the shop and nothing here takes a shop argument. A field returning null means the object is not published to this storefront, which is not distinguishable from its never having existed — deliberately, since a public token must not be able to probe for drafts.

Shop!

The shop this token belongs to.

Takes no argument: the token names the shop, and there is no way to ask for another one.

Localization!

Which locale this operation resolved in, and which are available.

Worth reading on first load even in a single-locale shop, because it carries the text direction a layout depends on.

[Province!]!

Every Iranian province — استان.

A fixed dataset that changes about once a decade. Fetch it once and cache it for as long as your build allows.

Returned whole rather than paged: thirty-one entries is not a collection that needs a cursor, and making every client page a constant is ceremony.

Province

One province by its code.

ArgumentTypeMeaning
codeString!No description.

[City!]!

The cities of one province — شهر.

query filters by name for a type-ahead. Requires a province: the national list runs to thousands of entries and no address form needs it whole, and one province’s worth always fits in a single response.

ArgumentTypeMeaning
provinceCodeString!No description.
queryStringNo description.

Product

One product, by id or by handle. Supply exactly one.

Null when it does not exist, is not published, or was unpublished since the link was made — the three are not distinguished, because distinguishing them tells a public caller what a merchant is preparing to launch.

ArgumentTypeMeaning
idIDNo description.
handleHandleNo description.

ProductConnection!

Published products.

query is a full-text search across title, description, vendor, and tags, Persian-normalized. For a search page, prefer search — it spans content types and returns facets and a spelling suggestion. This is for a listing.

ArgumentTypeMeaning
firstIntNo description.
afterStringNo description.
lastIntNo description.
beforeStringNo description.
queryStringNo description.
filters[ProductFilter!]Narrow to products matching every filter. Combines with query: both apply, and the result is what satisfies the text and the facets.
sortKeyProductSortKeys · default "BEST_SELLING"No description.
reverseBoolean · default falseNo description.

Collection

One collection, by id or by handle. Supply exactly one.

ArgumentTypeMeaning
idIDNo description.
handleHandleNo description.

CollectionConnection!

Published collections.

ArgumentTypeMeaning
firstIntNo description.
afterStringNo description.
lastIntNo description.
beforeStringNo description.
queryStringNo description.
sortKeyCollectionSortKeys · default "TITLE"No description.
reverseBoolean · default falseNo description.

TaxonomyCategory

One taxonomy category, by id or by handle. Supply exactly one.

ArgumentTypeMeaning
idIDNo description.
handleHandleNo description.

[TaxonomyCategory!]!

The top of the taxonomy, for building a category tree.

Only categories this shop has published products in — a menu of empty categories is worse than no menu.

[Product!]!

Products to show alongside another one.

Returned as a plain list rather than a connection: recommendations are a small fixed set chosen by the platform, not a collection anyone pages through.

The selection is behavioural and rule-based, and how it is made may improve behind this field — the same field, better answers, no change to any theme that already calls it.

ArgumentTypeMeaning
productIdID!No description.
intentProductRecommendationIntent · default "RELATED"No description.
limitInt · default 8No description.

SearchResultConnection!

Search the storefront.

Persian normalization — ZWNJ, ي→ی, ك→ک, digit folding, Finglish — happens server-side. Send what the buyer typed, unaltered.

ArgumentTypeMeaning
queryString!No description.
firstIntNo description.
afterStringNo description.
lastIntNo description.
beforeStringNo description.
types[SearchableType!] · default ["PRODUCT"]Which kinds of thing to search. Widening this widens the result union, so a client that renders only products should not ask for the other three.
productFilters[ProductFilter!]Facets to apply to the product results. Named productFilters and not filters because they narrow one member of the union and leave the rest alone: a price filter cannot mean anything to a page or an article, and silently dropping those from a mixed search would be the wrong reading of it.
sortKeySearchSortKeys · default "RELEVANCE"No description.
reverseBoolean · default falseNo description.
includeUnavailableBoolean · default trueWhether to include products that cannot be bought right now. True by default, and deliberately: a buyer searching for a thing by name wants to be told the shop has it and it is out of stock, not that the shop has never heard of it. Set it false for a picker that must only offer what can be added to a cart.

PredictiveSearchResult!

Suggestions for a search box, as the buyer types.

Cheap, fast, unpaginated. Debounce it; do not call it per keystroke.

ArgumentTypeMeaning
queryString!No description.
limitInt · default 5Suggestions per type, not in total.
types[SearchableType!] · default ["PRODUCT"]Which kinds of thing to suggest. Each is returned in its own list.

Cart

A cart by id.

Null when it never existed, has expired, became an order at checkout, or was given up. All of them mean the same thing to a theme: make a new one. A basket that became an order is not the buyer’s next basket, and a theme that kept it would show the goods just bought and refuse every change to them.

ArgumentTypeMeaning
idID!No description.

Order

A placed order, by the token hosted checkout returned with the buyer.

The token is a bearer credential for one order and nothing else. Null when it is wrong or has expired.

ArgumentTypeMeaning
tokenString!No description.

Page

One page, by id or by handle. Supply exactly one.

ArgumentTypeMeaning
idIDNo description.
handleHandleNo description.

PageConnection!

Published pages.

ArgumentTypeMeaning
firstIntNo description.
afterStringNo description.
lastIntNo description.
beforeStringNo description.
queryStringNo description.
sortKeyPageSortKeys · default "TITLE"No description.
reverseBoolean · default falseNo description.

Blog

One blog, by id or by handle. Supply exactly one.

ArgumentTypeMeaning
idIDNo description.
handleHandleNo description.

BlogConnection!

Every published blog.

ArgumentTypeMeaning
firstIntNo description.
afterStringNo description.

Article

One article, by id or by blog-and-article handle. Supply exactly one.

An article handle is unique within its blog, not across the shop, which is why addressing one by handle takes both.

ArgumentTypeMeaning
idIDNo description.
handleArticleHandleInputNo description.

ArticleConnection!

Articles across every blog — for a “latest posts” block.

ArgumentTypeMeaning
firstIntNo description.
afterStringNo description.
lastIntNo description.
beforeStringNo description.
queryStringNo description.
tagStringOnly articles carrying this tag, matched exactly, across every blog.
sortKeyArticleSortKeys · default "PUBLISHED_AT"No description.
reverseBoolean · default trueNo description.

Menu

One navigation menu, by handle.

Null when the merchant has not created one under that handle — which a theme should render as an absent menu, not as an error. A theme that hard-fails on a missing footer menu is a theme that breaks on a shop that did not want one.

ArgumentTypeMeaning
handleHandle!No description.

UrlRedirect

Whether a path has been redirected.

For a headless storefront doing its own routing: ask before rendering a 404. Null when the path is not redirected.

ArgumentTypeMeaning
pathString!No description.

Metaobject

One metaobject, by id or by type-and-handle. Supply exactly one.

ArgumentTypeMeaning
idIDNo description.
handleMetaobjectHandleInputNo description.

MetaobjectConnection!

Every published metaobject of one type.

ArgumentTypeMeaning
typeString!No description.
firstIntNo description.
afterStringNo description.
lastIntNo description.
beforeStringNo description.
sortKeyMetaobjectSortKeys · default "POSITION"No description.
reverseBoolean · default falseNo description.

Node

Re-fetch any object by its id.

What makes a normalizing client cache work: after a mutation, the cache refreshes exactly the objects that changed rather than re-running the query that produced them.

ArgumentTypeMeaning
idID!No description.

[Node]!

Re-fetch several objects at once.

Positional: one entry per id, in the order asked, null where there is nothing to return.

ArgumentTypeMeaning
ids[ID!]!No description.