Schema Documentation

user

Description

Returns a user

Response

Returns a User

Arguments
NameDescription
id - ID! The globally unique identifier of the user.
idType - UserNodeIdTypeEnum Type of unique identifier to fetch a user by. Default is Global ID

Example

Query
query user(
  $id: ID!,
  $idType: UserNodeIdTypeEnum
){
  user(
    id: $id,
    idType: $idType
  ){
    avatar {
      ...AvatarFragment
    }capKeycapabilitiescomments {
      ...UserToCommentConnectionFragment
    }databaseIddescriptionemailenqueuedScripts {
      ...UserToEnqueuedScriptConnectionFragment
    }enqueuedStylesheets {
      ...UserToEnqueuedStylesheetConnectionFragment
    }extraCapabilitiesfirstNameidisContentNodeisRestrictedisTermNodelastNamelocalemediaItems {
      ...UserToMediaItemConnectionFragment
    }namenicenamenicknamepages {
      ...UserToPageConnectionFragment
    }posts {
      ...UserToPostConnectionFragment
    }registeredDaterevisions {
      ...UserToContentRevisionUnionConnectionFragment
    }roles {
      ...UserToUserRoleConnectionFragment
    }seo {
      ...SEOUserFragment
    }sluguriurluserIdusernamewooSessionToken
  }
}
Variables
{"id":4,"idType":"DATABASE_ID"}
Response
{"data":{"user":{"avatar":Avatar,"capKey":"xyz789","capabilities":["abc123"],"comments":UserToCommentConnection,"databaseId":987,"description":"abc123","email":"abc123","enqueuedScripts":UserToEnqueuedScriptConnection,"enqueuedStylesheets":UserToEnqueuedStylesheetConnection,"extraCapabilities":["xyz789"],"firstName":"abc123","id":4,"isContentNode":true,"isRestricted":true,"isTermNode":true,"lastName":"abc123","locale":"abc123","mediaItems":UserToMediaItemConnection,"name":"abc123","nicename":"abc123","nickname":"xyz789","pages":UserToPageConnection,"posts":UserToPostConnection,"registeredDate":"abc123","revisions":UserToContentRevisionUnionConnection,"roles":UserToUserRoleConnection,"seo":SEOUser,"slug":"abc123","uri":"abc123","url":"abc123","userId":123,"username":"xyz789","wooSessionToken":"abc123"}}}