Skip to main content
Version: 3.x

product

Look up a product by ID.

Requires one of the following permissions to include the unpublished items: MANAGE_ORDERSMANAGE_DISCOUNTSMANAGE_PRODUCTS
product(
id: ID
slug: String
externalReference: String
channel: String
): Product

Arguments

product.id ● ID scalar

ID of the product.

product.slug ● String scalar

Slug of the product.

product.externalReference ● String scalar

External ID of the product.

Added in Saleor 3.10

product.channel ● String scalar

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

Type

Product object

Represents an individual item for sale in the storefront.

Examples

Get a product by ID

Get a product by ID

The following query retrieves the product with the associated ID. It returns the product fields specified in the query.

Query arguments
id: ID!The ID of the product to return
channel: StringSlug of a channel for which the data should be returned.
Query
{
product(id: "UHJvZHVjdDoxOTg=", channel: "default-channel") {
id
name
}
}
Response
{
"data": {
"product": {
"id": "UHJvZHVjdDoxOTg=",
"name": "ABBA Again"
}
},
"extensions": {
"cost": {
"requestedQueryCost": 1,
"maximumAvailable": 50000
}
}
}

Was this page helpful?