Skip to main content
Version: 3.x

products

List of the shop's products.

Requires one of the following permissions to include the unpublished items: MANAGE_ORDERSMANAGE_DISCOUNTSMANAGE_PRODUCTS
products(
filter: ProductFilterInput
where: ProductWhereInput
sortBy: ProductOrder
search: String
channel: String
before: String
after: String
first: Int
last: Int
): ProductCountableConnection

Arguments

products.filter ● ProductFilterInput input

Filtering options for products.

products.where ● ProductWhereInput input

Where filtering options.

Added in Saleor 3.14
This API is currently in Feature Preview and can be subject to changes at later point.

products.sortBy ● ProductOrder input

Sort products.

products.search ● String scalar

Search products.

Added in Saleor 3.14

products.channel ● String scalar

Slug of a channel for which the data should be returned.

products.before ● String scalar

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

products.after ● String scalar

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

products.first ● Int scalar

Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

products.last ● Int scalar

Retrieve the last n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.

Type

ProductCountableConnection object

Examples

Get products

Get the first ten products

The following query retrieves the first ten products for a channel and returns the associated ID.

Query arguments
first: IntReturn the first n elements from the list.
channel: StringSlug of a channel for which the data should be returned.

Returns up to the first n elements from the list.

Query
{
products(first: 10, channel: "default-channel") {
edges {
node {
id
name
}
}
}
}
Response
{
"data": {
"products": {
"edges": [
{
"node": {
"id": "UHJvZHVjdDoxOTY=",
"name": "1970-1982"
}
},
{
"node": {
"id": "UHJvZHVjdDoxOTg=",
"name": "ABBA Again"
}
},
{
"node": {
"id": "UHJvZHVjdDoyMDA=",
"name": "ABBA - MP3"
}
},
{
"node": {
"id": "UHJvZHVjdDoxNzc=",
"name": "Aniversario Los 10 Años De ABBA"
}
},
{
"node": {
"id": "UHJvZHVjdDoxNjY=",
"name": "A Wie ABBA (Die Grössten Erfolge Von »Waterloo« Bis »Super Trouper«)"
}
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 5,
"maximumAvailable": 50000
}
}
}
Expand ▼

Was this page helpful?