2018-11-06 09:30:27 +00:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
|
|
|
export const CREATE_USER = gql`
|
2019-10-08 16:28:35 +00:00
|
|
|
mutation CreateUser($email: String!, $password: String!, $locale: String) {
|
|
|
|
createUser(email: $email, password: $password, locale: $locale) {
|
2018-12-28 15:13:33 +00:00
|
|
|
email,
|
|
|
|
confirmationSentAt
|
2018-11-06 09:30:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const VALIDATE_USER = gql`
|
|
|
|
mutation ValidateUser($token: String!) {
|
|
|
|
validateUser(token: $token) {
|
2019-08-12 14:04:16 +00:00
|
|
|
accessToken,
|
|
|
|
refreshToken,
|
2018-11-06 09:30:27 +00:00
|
|
|
user {
|
|
|
|
id,
|
2019-01-30 14:54:21 +00:00
|
|
|
email,
|
|
|
|
defaultActor {
|
2019-10-07 11:47:46 +00:00
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
2019-01-30 14:54:21 +00:00
|
|
|
}
|
2018-11-06 09:30:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-01-18 13:47:10 +00:00
|
|
|
|
2019-09-24 16:47:35 +00:00
|
|
|
export const CHANGE_PASSWORD = gql`
|
|
|
|
mutation ChangePassword($oldPassword: String!, $newPassword: String!) {
|
|
|
|
changePassword(oldPassword: $oldPassword, newPassword: $newPassword) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-01-18 13:47:10 +00:00
|
|
|
export const CURRENT_USER_CLIENT = gql`
|
|
|
|
query {
|
|
|
|
currentUser @client {
|
|
|
|
id,
|
2019-04-01 09:49:54 +00:00
|
|
|
email,
|
|
|
|
isLoggedIn,
|
2019-09-09 07:31:08 +00:00
|
|
|
role
|
2019-01-18 13:47:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_CURRENT_USER_CLIENT = gql`
|
2019-09-11 07:59:01 +00:00
|
|
|
mutation UpdateCurrentUser($id: String!, $email: String!, $isLoggedIn: Boolean!, $role: UserRole!) {
|
2019-09-09 07:31:08 +00:00
|
|
|
updateCurrentUser(id: $id, email: $email, isLoggedIn: $isLoggedIn, role: $role) @client
|
2019-01-18 13:47:10 +00:00
|
|
|
}
|
2019-01-30 14:54:21 +00:00
|
|
|
`;
|