mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-02 02:30:29 +00:00
Add auth queries and mutations
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const SIGNUP = gql`
|
||||
mutation Signup(
|
||||
$email: String!
|
||||
$password: String!
|
||||
$firstName: String!
|
||||
$lastName: String!
|
||||
$phone: PhoneInputModel!
|
||||
$address: AddressInputModel!
|
||||
$active: Boolean!
|
||||
$role: Role!
|
||||
) {
|
||||
signup(
|
||||
email: $email
|
||||
password: $password
|
||||
firstName: $firstName
|
||||
lastName: $lastName
|
||||
phone: $phone
|
||||
address: $address
|
||||
active: $active
|
||||
role: $role
|
||||
) {
|
||||
user {
|
||||
id
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
phone {
|
||||
prefix
|
||||
number
|
||||
}
|
||||
address {
|
||||
place
|
||||
city
|
||||
country
|
||||
zip
|
||||
}
|
||||
active
|
||||
role
|
||||
}
|
||||
token
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const LOGIN = gql`
|
||||
mutation Login($email: String!, $password: String!) {
|
||||
login(email: $email, password: $password) {
|
||||
user {
|
||||
id
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
phone {
|
||||
prefix
|
||||
number
|
||||
}
|
||||
address {
|
||||
place
|
||||
city
|
||||
country
|
||||
zip
|
||||
}
|
||||
active
|
||||
role
|
||||
}
|
||||
token
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const RESET_PASSWORD = gql`
|
||||
mutation ResetPassword($email: String!) {
|
||||
resetUserPassword(email: $email) {
|
||||
id
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
phone {
|
||||
prefix
|
||||
number
|
||||
}
|
||||
address {
|
||||
place
|
||||
city
|
||||
country
|
||||
zip
|
||||
}
|
||||
active
|
||||
role
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CONFIRM_USER_RESET_PASSWORD = gql`
|
||||
mutation ConfirmUserResetPassword($id: String!, $password: String!) {
|
||||
confirmUserResetPassword(id: $id, password: $password) {
|
||||
id
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
phone {
|
||||
prefix
|
||||
number
|
||||
}
|
||||
address {
|
||||
place
|
||||
city
|
||||
country
|
||||
zip
|
||||
}
|
||||
active
|
||||
role
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user