User Object
Represents user data.
type User implements Node, ObjectWithMetadata, ObjectWithAttributes {
id: ID!
privateMetadata: [MetadataItem!]!
privateMetafield(
key: String!
): String
privateMetafields(
keys: [String!]
): Metadata
metadata: [MetadataItem!]!
metafield(
key: String!
): String
metafields(
keys: [String!]
): Metadata
assignedAttribute(
slug: String!
): AssignedAttribute
assignedAttributes(
limit: PositiveInt = 100
): [AssignedAttribute!]!
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
note: String
orders(
where: CustomerOrderWhereInput
before: String
after: String
first: Int
last: Int
): OrderCountableConnection
userPermissions: [UserPermission!]
permissionGroups: [Group!]
editableGroups: [Group!]
accessibleChannels: [Channel!]
restrictedAccessToChannels: Boolean!
avatar(
size: Int
format: ThumbnailFormatEnum = ORIGINAL
): Image
events: [CustomerEvent!]
storedPaymentSources(
channel: String
): [PaymentSource!] @deprecated
languageCode: LanguageCodeEnum!
defaultShippingAddress: Address
defaultBillingAddress: Address
externalReference: String
customerType: CustomerType
lastLogin: DateTime
dateJoined: DateTime!
updatedAt: DateTime!
storedPaymentMethods(
channel: String!
): [StoredPaymentMethod!]
}
Fields
id ● ID!
The ID of the user.
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!]
assignedAttribute ● AssignedAttribute
Get a single attribute assigned to the user by attribute slug. The attribute is looked up among the attributes of the user's customer type.
The owner can access only attributes that are visible in the storefront.
Added in Saleor 3.23slug ● String!
Slug of the attribute
assignedAttributes ● [AssignedAttribute!]!
List of attributes assigned to the user through the user's customer type.
The owner can access only attributes that are visible in the storefront.
Added in Saleor 3.23limit ● PositiveInt
Maximum number of attributes to return. Default is 100.
email ● String!
The email address of the user.
firstName ● String!
The given name of the address.
lastName ● String!
The family name of the address.
isStaff ● Boolean!
Determine if the user is a staff admin.
isActive ● Boolean!
Determine if the user is active.
isConfirmed ● Boolean!
Determines if user has confirmed email.
addresses ● [Address!]!
List of all user's addresses.
checkoutIds ● [ID!]
Returns the checkout ID's assigned to this user.
channel ● String
Slug of a channel for which the data should be returned.
checkouts ● CheckoutCountableConnection
Returns checkouts assigned to this user. The query will not initiate any external requests, including fetching external shipping methods, filtering available shipping methods, or performing external tax calculations.
channel ● String
Slug of a channel for which the data should be returned.
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.
giftCards ● GiftCardCountableConnection
List of the user gift cards.
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.
note ● String
A note about the customer.
orders ● OrderCountableConnection
List of user's orders. The query will not initiate any external requests, including filtering available shipping methods, or performing external tax calculations.
where ● CustomerOrderWhereInput
Where filtering options for orders.
Added in Saleor 3.22before ● 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.
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.
accessibleChannels ● [Channel!]
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.
restrictedAccessToChannels ● Boolean!
Determine if user have restricted access to channels. False if at least one user group has restrictedAccessToChannels set to False.
avatar ● Image
The avatar of the user.
size ● Int
Desired longest side the image in pixels. Defaults to 4096. Images are never cropped. Pass 0 to retrieve the original size (not recommended).
format ● ThumbnailFormatEnum
The format of the image. When not provided, format of the original image will be used.
events ● [CustomerEvent!]
List of events associated with the user.
languageCode ● LanguageCodeEnum!
User language code.
defaultShippingAddress ● Address
The default shipping address of the user.
defaultBillingAddress ● Address
The default billing address of the user.
externalReference ● String
External ID of this user.
customerType ● CustomerType
The customer type assigned to the user.
Added in Saleor 3.23lastLogin ● DateTime
The date when the user last time log in to the system.
dateJoined ● DateTime!
The data when the user create account.
updatedAt ● DateTime!
The data when the user last update the account information.
storedPaymentMethods ● [StoredPaymentMethod!]
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.
channel ● String!
Slug of a channel for which the data should be returned.
Show deprecatedHide deprecated
checkout ● Checkout
Use the checkoutTokens field to fetch the user checkouts.
Returns the last open checkout of this user.
checkoutTokens ● [UUID!]
Use checkoutIds instead.
Returns the checkout UUID's assigned to this user.
channel ● String
Slug of a channel for which the data should be returned.
storedPaymentSources ● [PaymentSource!]
The legacy Payments API is deprecated and will be removed. Use the Transactions API instead.
List of stored payment sources. The field returns a list of payment sources stored for payment plugins.
channel ● String
Slug of a channel for which the data should be returned.
Interfaces
Node
An object with an ID
ObjectWithMetadata
ObjectWithAttributes
An object with attributes.
Added in Saleor 3.22Returned By
Member Of
AccountAddressCreate object ● AccountAddressDelete object ● AccountAddressUpdate object ● AccountChangeEmailRequested object ● AccountConfirmationRequested object ● AccountConfirmed object ● AccountDelete object ● AccountDeleted object ● AccountDeleteRequested object ● AccountEmailChanged object ● AccountRegister object ● AccountSetDefaultAddress object ● AccountSetPasswordRequested object ● AccountUpdate object ● AddressCreate object ● AddressDelete object ● AddressSetDefault object ● AddressUpdate object ● AppProblemDismissed object ● Checkout object ● ConfirmAccount object ● ConfirmEmailChange object ● CreateToken object ● CustomerBulkResult object ● CustomerCreate object ● CustomerCreated object ● CustomerDelete object ● CustomerDeleted object ● CustomerEvent object ● CustomerMetadataUpdated object ● CustomerUpdate object ● CustomerUpdated object ● ExportEvent object ● ExportFile object ● ExternalObtainAccessTokens object ● ExternalRefresh object ● ExternalVerify object ● GiftCard object ● GiftCardEvent object ● GiftCardEventAssignment object ● Group object ● ListStoredPaymentMethods object ● Order object ● OrderEvent object ● OrderGrantedRefund object ● PasswordChange object ● PaymentGatewayInitializeTokenizationSession object ● PaymentMethodInitializeTokenizationSession object ● PaymentMethodProcessTokenizationSession object ● RefreshToken object ● RequestEmailChange object ● SetPassword object ● StaffCreate object ● StaffCreated object ● StaffDelete object ● StaffDeleted object ● StaffNotificationRecipient object ● StaffSetPasswordRequested object ● StaffUpdate object ● StaffUpdated object ● StoredPaymentMethodDeleteRequested object ● UserAvatarDelete object ● UserAvatarUpdate object ● UserCountableEdge object ● VerifyToken object
Implemented By
_Entity union ● IssuingPrincipal union ● UserOrApp union