> Documentation index: [Saleor](/llms.txt) · [This section](/api-reference/products/llms.txt)
> Source: https://docs.saleor.io/api-reference/products/queries/product-variants

# productVariants Query

List of product variants.

Requires one of the following permissions to include the unpublished items: MANAGE\_ORDERS MANAGE\_DISCOUNTS MANAGE\_PRODUCTS

```graphql
productVariants(
  ids: [ID!]
  channel: String
  filter: ProductVariantFilterInput
  where: ProductVariantWhereInput
  search: String
  sortBy: ProductVariantSortingInput
  before: String
  after: String
  first: Int
  last: Int
): ProductVariantCountableConnection
```

Details

```graphql
type ProductVariantCountableConnection {
  pageInfo: PageInfo!
  edges: [ProductVariantCountableEdge!]!
  totalCount: Int
}
```

<a id="arguments"></a>

### Arguments

<a id="ids"></a>

#### [`ids`](#ids) ● [`[ID!]`](/api-reference/miscellaneous/scalars/id.md)

Filter product variants by given IDs.

<a id="channel"></a>

#### [`channel`](#channel) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="where"></a>

#### [`where`](#where) ● [`ProductVariantWhereInput`](/api-reference/products/inputs/product-variant-where-input.md)

Where filtering options for product variants.

<a id="search"></a>

#### [`search`](#search) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

Search product variants.

Added in Saleor 3.22

<a id="sort-by"></a>

#### [`sortBy`](#sort-by) ● [`ProductVariantSortingInput`](/api-reference/products/inputs/product-variant-sorting-input.md)

Sort products variants.

<a id="before"></a>

#### [`before`](#before) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="after"></a>

#### [`after`](#after) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

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

<a id="first"></a>

#### [`first`](#first) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

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

<a id="last"></a>

#### [`last`](#last) ● [`Int`](/api-reference/miscellaneous/scalars/int.md)

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

Show deprecatedHide deprecated

<a id="filter"></a>

#### [`filter`](#filter) ● [`ProductVariantFilterInput`](/api-reference/products/inputs/product-variant-filter-input.md)

DEPRECATED

Use `where` filter instead.

Filtering options for product variants.

<a id="type"></a>

### Type

<a id="productvariantcountableconnection"></a>

#### [`ProductVariantCountableConnection`](/api-reference/products/objects/product-variant-countable-connection.md)
