Docs
Dashboard

products

Query

Retrieves a paged list of products with optional filtering, sorting, and full-text search.

#

Arguments


after
String

Returns the elements in the list that come after the specified cursor.

before
String

Returns the elements in the list that come before the specified cursor.

first
Int

Returns the first n elements from the list.

last
Int

Returns the last n elements from the list.

query
String
A filter expression made up of terms, boolean operators, modifiers, and comparators. Combine one or more filters in a single query.
Available filters14
  • defaultstring

    Searches indexed product text such as names, vendors, SKUs, and tags. Every term must match.

    Examplesportable lamp"Portable Lamp"
  • idID

    Matches a product by its unique identifier.

    Exampleid:product_...
  • namestring

    Matches the product name. Phrases and prefix wildcards are supported.

    Examplesname:"Portable Lamp"name:port*
  • vendorstring

    Matches the product vendor.

    Examplevendor:acme
  • statusstring

    Matches the product's lifecycle status.

    Examplestatus:active
  • skustring

    Matches the SKU of any variant belonging to the product.

    Examplesku:LAMP-01
  • variant_idID

    Matches a product containing the specified variant.

    Examplevariant_id:vid_...
  • tagstring

    Matches a tag assigned to the product.

    Exampletag:lighting
  • category_idID

    Matches a product assigned to the specified category.

    Examplecategory_id:cat_...
  • collection_idID

    Matches a product assigned to the specified collection.

    Examplecollection_id:col_...
  • metadata.<key>string

    Matches, prefix-matches, or checks for an indexed metadata value.

    Examplesmetadata.import_source:erpmetadata.import_source:*
  • metafields.<namespace>.<key>string | number

    Matches a public metafield value, checks for its presence, or compares a numeric value.

    Examplesmetafields.specs.material:oakmetafields.specs.wattage:>=40
  • attributes.<attribute-name>string

    Matches a product attribute value.

    Exampleattributes.color:blue
  • available_for_saleboolean

    Matches products that are or are not available for sale in the current request context.

    Exampleavailable_for_sale:true
sortDirection
SortDirection

Sort direction (ascending or descending).

Possible enum values
  • ASC

    Orders values from lowest to highest or alphabetically from A to Z.

  • DESC

    Orders values from highest to lowest or alphabetically from Z to A.

sortKey
ProductSortKeys

Field key to sort by.

Possible enum values
  • ID

    Sort by product identifier.

  • NAME

    Sort by product name.

  • PRICE

    Sorts by product variant prices, if ASC is specified, it will sort by the lowest price of the variants. If DESC is specified, it will sort by the highest price of the variants.

  • VENDOR

    Sort by the vendor value.

#

Payload


edges
[ProductEdge!]

A list of edges.

nodes
[Product!]

A flattened list of the nodes

pageInfo
PageInfo!

Information to aid in pagination.

totalCount
Int!

Identifies the total count of items in the connection.