Login User
Use this mutation to login a user.
Use the login mutation to obtain a JWT authentication for third parties only. This sends a user_id
and returns an access token and a refresh token.
Requirements
To have the userId which will indicate the user who will be logged in.
Required Argument
Available Fields
Access token that is passed in the header
The refresh token that is used to obtain another access_token when the current one expires
Example
mutation {
login(userId: "305c5386-1e1e-4d01-019f-521b2d94e9e4") {
accessToken
refreshToken
}
}
{
"data": {
"login": {
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjQ0MDgyMDAsInVpZCI6IjMwNWM1Mzg2LWI3YjgtNGQwMS05ZjRlLTUyMWIyZDk0ZTllNCIsInBpZCI6IjQ2YmY0ZmM1LWI5N2QtNDU2Mi05NDkyLWI1OGZhNDkwYzU0YSIsImlzcyI6InNnOmFwcCIsImF1ZCI6InNnOnVzZXIiLCJpYXQiOjE2MjMxOTg2MDAsImNhdCI6IjIwMjEwNTAyMjAxNCIsImFwcCI6ImxpbGlhbmFzdWdnZXN0aWNjb20ifQ.wzx6i36BO8FOihpm012WeKcdljSVRE5GQcRd_h-0zf8",
"refreshToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjU2MTc4MDAsInVpZCI6IjMwNWM1Mzg2LWI3YjgtNGQwMS05ZjRlLTUyMWIyZDk0ZTllNCIsInBpZCI6IjQ2YmY0ZmM1LWI5N2QtNDU2Mi05NDkyLWI1OGZhNDkwYzU0YSIsImlzcyI6InNnOmFwcCIsImF1ZCI6InNnOnVzZXIiLCJpYXQiOjE2MjMxOTg2MDAsImNhdCI6IjIwMjEwNTAyMjAxNCIsImFwcCI6ImxpbGlhbmFzdWdnZXN0aWNjb20ifQ.BJutOP6mhLyryiklBrX-fdI4HFu0Z68Lzbe_9nTWcVc"
}
}
}