Add config endpoint

This commit is contained in:
Chocobozzz
2019-03-22 10:53:38 +01:00
parent 0b1845a1fb
commit e864b38ec6
11 changed files with 157 additions and 11 deletions

40
js/src/graphql/config.ts Normal file
View File

@@ -0,0 +1,40 @@
import gql from 'graphql-tag';
export const CREATE_USER = gql`
mutation CreateUser($email: String!, $password: String!) {
createUser(email: $email, password: $password) {
email,
confirmationSentAt
}
}
`;
export const VALIDATE_USER = gql`
mutation ValidateUser($token: String!) {
validateUser(token: $token) {
token,
user {
id,
email,
defaultActor {
id
}
}
}
}
`;
export const CURRENT_USER_CLIENT = gql`
query {
currentUser @client {
id,
email
}
}
`;
export const UPDATE_CURRENT_USER_CLIENT = gql`
mutation UpdateCurrentUser($id: Int!, $email: String!) {
updateCurrentUser(id: $id, email: $email) @client
}
`;

View File

@@ -0,0 +1,7 @@
import { ICurrentUser } from '@/types/current-user.model';
export interface ILogin {
user: ICurrentUser,
token: string,
}