The currentUser type returns the currently logged-in user’s User record data, even if the caller doesn’t know the user ID. The response always represents the current user. You can request any fields that are available on the User record.
To query or aggregate multiple users or use complex filtering, sorting, or pagination, use the RecordQuery type for the User object instead. See Query Objects.
To get the current user record, use currentUser in the uiapi field.
Query currentUser
1{2 uiapi{3 currentUser{4 # User fields5}6}7}
Current User Schema
Query currentUser by using this schema.
Query currentUser Schema
1type UIAPI{2 currentUser: RecordRepresentation3}
Example: Query Current User
This example fetches the ID and name for the current user.