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