Skip to content

User

Get the currently authenticated user

Unlike many other queries, the Viewer query infers the current user from the access token. This is the simplest way to get the current user.

INFO

If you only require the user ID, you can use a JWT library to decode the access token and get the user ID from the sub field.

Apollo Studio

graphql
query {
  Viewer {
    id
    name
  }
}