CustomerType Object
Represents a type of customer. It allows to segment users and defines what attributes are available to users of this type.
Added in Saleor 3.23type CustomerType 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!
isDefault: Boolean!
attributes: [Attribute!]
availableAttributes(
where: AttributeWhereInput
search: String
before: String
after: String
first: Int
last: Int
): AttributeCountableConnection
}
Fields
id ● ID!
The ID of the customer type.
privateMetadata ● [MetadataItem!]!
List of private metadata items. Requires staff permissions to access.
privateMetafield ● String
A single key from private metadata. Requires staff permissions to access.
Tip: Use GraphQL aliases to fetch multiple keys.
key ● String!
privateMetafields ● Metadata
Private metadata. Requires staff permissions to access. Use keys to control which fields you want to include. The default is to include everything.
keys ● [String!]
metadata ● [MetadataItem!]!
List of public metadata items. Can be accessed without permissions.
metafield ● String
A single key from public metadata.
Tip: Use GraphQL aliases to fetch multiple keys.
key ● String!
metafields ● Metadata
Public metadata. Use keys to control which fields you want to include. The default is to include everything.
keys ● [String!]
name ● String!
Name of the customer type.
slug ● String!
Slug of the customer type.
isDefault ● Boolean!
Whether this is the default customer type. The default customer type is assigned to every newly created user and cannot be deleted.
attributes ● [Attribute!]
Customer attributes assigned to this customer type. Attributes that are not visible in the storefront require one of the following permissions to be included: MANAGE_USERS, MANAGE_CUSTOMER_TYPES_AND_ATTRIBUTES.
availableAttributes ● AttributeCountableConnection
Customer attributes that can be assigned to the customer type.
where ● AttributeWhereInput
Where filtering options for attributes.
search ● String
Search attributes.
before ● String
Return the elements in the list that come before the specified cursor.
after ● String
Return the elements in the list that come after the specified cursor.
first ● Int
Retrieve the first n elements from the list. Note that the system only allows fetching a maximum of 100 objects in a single query.
last ● Int
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
An object with an ID
ObjectWithMetadata
Returned By
customerType query
Member Of
CustomerTypeAssignAttributes object ● CustomerTypeCountableEdge object ● CustomerTypeCreate object ● CustomerTypeCreated object ● CustomerTypeDelete object ● CustomerTypeDeleted object ● CustomerTypeReorderAttributes object ● CustomerTypeUnassignAttributes object ● CustomerTypeUpdate object ● CustomerTypeUpdated object ● User object