Skip to main content
Version: 3.x

User

Represents user data.

type User 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
email: String!
firstName: String!
lastName: String!
isStaff: Boolean!
isActive: Boolean!
addresses: [Address!]
checkout: Checkout
checkoutTokens(channel: String): [UUID!]
checkoutIds(channel: String): [ID!]
giftCards(
before: String
after: String
first: Int
last: Int
): GiftCardCountableConnection
note: String
orders(
before: String
after: String
first: Int
last: Int
): OrderCountableConnection
userPermissions: [UserPermission!]
permissionGroups: [Group!]
editableGroups: [Group!]
avatar(size: Int, format: ThumbnailFormatEnum): Image
events: [CustomerEvent!]
storedPaymentSources(channel: String): [PaymentSource!]
languageCode: LanguageCodeEnum!
defaultShippingAddress: Address
defaultBillingAddress: Address
lastLogin: DateTime
dateJoined: DateTime!
updatedAt: DateTime!
}

Fields

id (ID!)

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.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

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.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

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.

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

metafields (Metadata)

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

Added in Saleor 3.3.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

email (String!)

firstName (String!)

lastName (String!)

isStaff (Boolean!)

isActive (Boolean!)

addresses ([Address!])

List of all user's addresses.

checkout (Checkout)

Returns the last open checkout of this user.

checkoutTokens ([UUID!])

Returns the checkout UUID's assigned to this user.

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

checkoutIds ([ID!])

Returns the checkout ID's assigned to this user.

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

giftCards (GiftCardCountableConnection)

List of the user gift cards.

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

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

Return the first n elements from the list.

Return the last n elements from the list.

note (String)

A note about the customer.

Requires one of the following permissions: MANAGE_USERS, MANAGE_STAFF.

orders (OrderCountableConnection)

List of user's orders. Requires one of the following permissions: MANAGE_STAFF, OWNER.

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

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

Return the first n elements from the list.

Return the last n elements from the list.

userPermissions ([UserPermission!])

List of user's permissions.

permissionGroups ([Group!])

List of user's permission groups.

editableGroups ([Group!])

List of user's permission groups which user can manage.

avatar (Image)

Size of the image. If not provided, the original image will be returned.

The format of the image. When not provided, format of the original image will be used. Must be provided together with the size value, otherwise original image will be returned.

Added in Saleor 3.6.

Note: this API is currently in Feature Preview and can be subject to changes at later point.

events ([CustomerEvent!])

List of events associated with the user.

Requires one of the following permissions: MANAGE_USERS, MANAGE_STAFF.

storedPaymentSources ([PaymentSource!])

List of stored payment sources.

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

languageCode (LanguageCodeEnum!)

User language code.

defaultShippingAddress (Address)

defaultBillingAddress (Address)

lastLogin (DateTime)

dateJoined (DateTime!)

updatedAt (DateTime!)

Interfaces

Node

An object with an ID

ObjectWithMetadata