Skip to main content
Version: 3.x

ProductType

Represents a type of product. It defines what attributes are available to products of this type.

type ProductType implements Node, ObjectWithMetadata {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(key: String!): String
privateMetafields(keys: [String!]): Metadata
metadata: [MetadataItem!]!
metafield(key: String!): String
metafields(keys: [String!]): Metadata
name: String!
slug: String!
hasVariants: Boolean!
isShippingRequired: Boolean!
isDigital: Boolean!
weight: Weight
kind: ProductTypeKindEnum!
products(
channel: String
before: String
after: String
first: Int
last: Int
): ProductCountableConnection @deprecated
taxType: TaxType @deprecated
taxClass: TaxClass
variantAttributes(variantSelection: VariantAttributeScope): [Attribute!]
@deprecated
assignedVariantAttributes(
variantSelection: VariantAttributeScope
): [AssignedVariantAttribute!]
productAttributes: [Attribute!]
availableAttributes(
filter: AttributeFilterInput
where: AttributeWhereInput
before: String
after: String
first: Int
last: Int
): AttributeCountableConnection
}
Expand ▼

Fields

ProductType.id ● ID! non-null scalar

The ID of the product type.

ProductType.privateMetadata ● [MetadataItem!]! non-null object

List of private metadata items. Requires staff permissions to access.

ProductType.privateMetafield ● String scalar

A single key from private metadata. Requires staff permissions to access.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3
ProductType.privateMetafield.key ● String! non-null scalar

ProductType.privateMetafields ● Metadata scalar

Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.

Added in Saleor 3.3
ProductType.privateMetafields.keys ● [String!] list scalar

ProductType.metadata ● [MetadataItem!]! non-null object

List of public metadata items. Can be accessed without permissions.

ProductType.metafield ● String scalar

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

Added in Saleor 3.3
ProductType.metafield.key ● String! non-null scalar

ProductType.metafields ● Metadata scalar

Public metadata. Use keys to control which fields you want to include. The default is to include everything.

Added in Saleor 3.3
ProductType.metafields.keys ● [String!] list scalar

ProductType.name ● String! non-null scalar

Name of the product type.

ProductType.slug ● String! non-null scalar

Slug of the product type.

ProductType.hasVariants ● Boolean! non-null scalar

Whether the product type has variants.

ProductType.isShippingRequired ● Boolean! non-null scalar

Whether shipping is required for this product type.

ProductType.isDigital ● Boolean! non-null scalar

Whether the product type is digital.

ProductType.weight ● Weight object

Weight of the product type.

ProductType.kind ● ProductTypeKindEnum! non-null enum

The product type kind.

ProductType.products ● ProductCountableConnection deprecated object

DEPRECATED

This field will be removed in Saleor 4.0. Use the top-level products query with the productTypes filter.

List of products of this type.

ProductType.products.channel ● String scalar

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

ProductType.products.before ● String scalar

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

ProductType.products.after ● String scalar

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

ProductType.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.

ProductType.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.

ProductType.taxType ● TaxType deprecated object

DEPRECATED

This field will be removed in Saleor 4.0. Use taxClass field instead.

A type of tax. Assigned by enabled tax gateway

ProductType.taxClass ● TaxClass object

Tax class assigned to this product type. All products of this product type use this tax class, unless it's overridden in the Product type.

Requires one of the following permissions: AUTHENTICATED_STAFF_USERAUTHENTICATED_APP

ProductType.variantAttributes ● [Attribute!] deprecated list object

DEPRECATED

This field will be removed in Saleor 4.0. Use assignedVariantAttributes instead.

Variant attributes of that product type.

ProductType.variantAttributes.variantSelection ● VariantAttributeScope enum

Define scope of returned attributes.

ProductType.assignedVariantAttributes ● [AssignedVariantAttribute!] list object

Variant attributes of that product type with attached variant selection.

Added in Saleor 3.1
ProductType.assignedVariantAttributes.variantSelection ● VariantAttributeScope enum

Define scope of returned attributes.

ProductType.productAttributes ● [Attribute!] list object

Product attributes of that product type.

ProductType.availableAttributes ● AttributeCountableConnection object

List of attributes which can be assigned to this product type.

Requires MANAGE_PRODUCTSpermission.
ProductType.availableAttributes.filter ● AttributeFilterInput input
ProductType.availableAttributes.where ● AttributeWhereInput input
ProductType.availableAttributes.before ● String scalar

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

ProductType.availableAttributes.after ● String scalar

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

ProductType.availableAttributes.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.

ProductType.availableAttributes.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.

Interfaces

Node interface

An object with an ID

ObjectWithMetadata interface

Returned by

productType query

Member of

Product object ● ProductAttributeAssign object ● ProductAttributeAssignmentUpdate object ● ProductAttributeUnassign object ● ProductTypeCountableEdge object ● ProductTypeCreate object ● ProductTypeDelete object ● ProductTypeReorderAttributes object ● ProductTypeUpdate object

Implemented by

_Entity union


Was this page helpful?