Skip to main content
Version: Canary 🚧

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!
isConfirmed: Boolean!
addresses: [Address!]!
checkout: Checkout @deprecated
checkoutTokens(channel: String): [UUID!] @deprecated
checkoutIds(channel: String): [ID!]
checkouts(
channel: String
before: String
after: String
first: Int
last: Int
): CheckoutCountableConnection
giftCards(
before: String
after: String
first: Int
last: Int
): GiftCardCountableConnection
userPermissions: [UserPermission!]
permissionGroups: [Group!]
editableGroups: [Group!]
accessibleChannels: [Channel!]
restrictedAccessToChannels: Boolean!
avatar(size: Int, format: ThumbnailFormatEnum = ORIGINAL): Image
storedPaymentSources(channel: String): [PaymentSource!]
languageCode: LanguageCodeEnum!
defaultShippingAddress: Address
defaultBillingAddress: Address
externalReference: String
lastLogin: DateTime
dateJoined: DateTime!
updatedAt: DateTime!
storedPaymentMethods(channel: String!): [StoredPaymentMethod!]
}
Expand ▼

Fields

User.id ● ID! non-null scalar

The ID of the user.

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

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

User.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
User.privateMetafield.key ● String! non-null scalar

User.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
User.privateMetafields.keys ● [String!] list scalar

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

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

User.metafield ● String scalar

A single key from public metadata.

Tip: Use GraphQL aliases to fetch multiple keys.

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

User.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
User.metafields.keys ● [String!] list scalar

User.email ● String! non-null scalar

The email address of the user.

User.firstName ● String! non-null scalar

The given name of the address.

User.lastName ● String! non-null scalar

The family name of the address.

User.isStaff ● Boolean! non-null scalar

Determine if the user is a staff admin.

User.isActive ● Boolean! non-null scalar

Determine if the user is active.

User.isConfirmed ● Boolean! non-null scalar

Determines if user has confirmed email.

Added in Saleor 3.15

User.addresses ● [Address!]! non-null object

List of all user's addresses.

User.checkout ● Checkout deprecated object

DEPRECATED

This field will be removed in Saleor 4.0. Use the checkoutTokens field to fetch the user checkouts.

Returns the last open checkout of this user.

User.checkoutTokens ● [UUID!] deprecated list scalar

DEPRECATED

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

Returns the checkout UUID's assigned to this user.

User.checkoutTokens.channel ● String scalar

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

User.checkoutIds ● [ID!] list scalar

Returns the checkout ID's assigned to this user.

User.checkoutIds.channel ● String scalar

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

User.checkouts ● CheckoutCountableConnection object

Returns checkouts assigned to this user.

Added in Saleor 3.8
User.checkouts.channel ● String scalar

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

User.checkouts.before ● String scalar

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

User.checkouts.after ● String scalar

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

User.checkouts.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.

User.checkouts.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.

User.giftCards ● GiftCardCountableConnection object

List of the user gift cards.

User.giftCards.before ● String scalar

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

User.giftCards.after ● String scalar

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

User.giftCards.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.

User.giftCards.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.

User.userPermissions ● [UserPermission!] list object

List of user's permissions.

User.permissionGroups ● [Group!] list object

List of user's permission groups.

User.editableGroups ● [Group!] list object

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

User.accessibleChannels ● [Channel!] list object

List of channels the user has access to. The sum of channels from all user groups. If at least one group has restrictedAccessToChannels set to False - all channels are returned.

Added in Saleor 3.14
This API is currently in Feature Preview and can be subject to changes at later point.

User.restrictedAccessToChannels ● Boolean! non-null scalar

Determine if user have restricted access to channels. False if at least one user group has restrictedAccessToChannels set to False.

Added in Saleor 3.14
This API is currently in Feature Preview and can be subject to changes at later point.

User.avatar ● Image object

The avatar of the user.

User.avatar.size ● Int scalar

Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended).

User.avatar.format ● ThumbnailFormatEnum enum

The format of the image. When not provided, format of the original image will be used.

Added in Saleor 3.6

User.storedPaymentSources ● [PaymentSource!] list object

List of stored payment sources. The field returns a list of payment sources stored for payment plugins.

User.storedPaymentSources.channel ● String scalar

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

User.languageCode ● LanguageCodeEnum! non-null enum

User language code.

User.defaultShippingAddress ● Address object

The default shipping address of the user.

User.defaultBillingAddress ● Address object

The default billing address of the user.

User.externalReference ● String scalar

External ID of this user.

Added in Saleor 3.10

User.lastLogin ● DateTime scalar

The date when the user last time log in to the system.

User.dateJoined ● DateTime! non-null scalar

The data when the user create account.

User.updatedAt ● DateTime! non-null scalar

The data when the user last update the account information.

User.storedPaymentMethods ● [StoredPaymentMethod!] list object

Returns a list of user's stored payment methods that can be used in provided channel. The field returns a list of stored payment methods by payment apps. When amount is not provided, 0 will be used as default value.

Added in Saleor 3.15
This API is currently in Feature Preview and can be subject to changes at later point.
User.storedPaymentMethods.channel ● String! non-null scalar

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

Interfaces

Node interface

An object with an ID

ObjectWithMetadata interface

Returned by

me query

Member of

AccountRegister object ● ConfirmAccount object ● CreateToken object ● ExternalObtainAccessTokens object ● ExternalRefresh object ● ExternalVerify object ● GiftCard object ● RefreshToken object ● SetPassword object ● VerifyToken object

Implemented by

_Entity union ● IssuingPrincipal union ● UserOrApp union


Was this page helpful?