Skip to main content

Sessions

Describes operations for terminating one or all active sessions of the current user.

End a specific session​

MutationdocumentId: logoutSessionauth: Bearer session

logoutSession​

Description​

Terminates one active session owned by the current user using the identifier returned by sessions.

Input​

FieldTypeRequiredDescription
idID!✓Identifier returned by sessions.

Result​

Response type - OperationResult.

Errors​

  • UNAUTHENTICATED - the user is not authenticated.
  • SESSION_NOT_FOUND - the session was not found.
  • CANNOT_LOGOUT_CURRENT - the supplied ID identifies the current session.

Exchange example​

Request
documentId: logoutSession
{
"documentId": "logoutSession",
"variables": {
"id": "019bef0c-2d38-7c98-a11d-d2d7ccf7e7cb"
}
}
Response
200 OK
{
"data": {
"logoutSession": {
"success": true
}
}
}

End all sessions​

MutationdocumentId: logoutAllSessionsauth: Bearer session

logoutAllSessions​

Description​

Terminates every active session owned by the current user, including the current session. The current bearer token becomes invalid immediately.

Input​

The operation does not accept variables.

Result​

Response type - OperationResult.

Errors​

  • UNAUTHENTICATED - the user is not authenticated.

Exchange example​

Request
documentId: logoutAllSessions
{
"documentId": "logoutAllSessions",
"variables": {}
}
Response
200 OK
{
"data": {
"logoutAllSessions": {
"success": true
}
}
}