mobilizon/js/src/graphql/user.ts

44 lines
816 B
TypeScript
Raw Normal View History

import gql from 'graphql-tag';
export const CREATE_USER = gql`
mutation CreateUser($email: String!, $password: String!) {
createUser(email: $email, password: $password) {
2018-12-28 16:13:33 +01:00
email,
confirmationSentAt
}
}
`;
export const VALIDATE_USER = gql`
mutation ValidateUser($token: String!) {
validateUser(token: $token) {
2019-08-12 16:04:16 +02:00
accessToken,
refreshToken,
user {
id,
email,
defaultActor {
id
}
}
}
}
`;
2019-01-18 14:47:10 +01:00
export const CURRENT_USER_CLIENT = gql`
query {
currentUser @client {
id,
email,
isLoggedIn,
role
2019-01-18 14:47:10 +01:00
}
}
`;
export const UPDATE_CURRENT_USER_CLIENT = gql`
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
}
`;