2018-11-06 10:30:27 +01:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
|
|
|
export const CREATE_USER = gql`
|
2019-01-29 11:02:32 +01:00
|
|
|
mutation CreateUser($email: String!, $password: String!) {
|
|
|
|
createUser(email: $email, password: $password) {
|
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 {
|
|
|
|
id
|
|
|
|
}
|
2018-11-06 10:30:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
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-09 09:31:08 +02:00
|
|
|
mutation UpdateCurrentUser($id: Int!, $email: String!, $isLoggedIn: Boolean!, $role: UserRole!) {
|
|
|
|
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
|
|
|
`;
|