mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-01 18:20:28 +00:00
Add admin queries and mutations
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const GET_ALL_USERS = gql`
|
||||
query GetAllUsers {
|
||||
getAllUsers {
|
||||
id
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
phone {
|
||||
prefix
|
||||
number
|
||||
}
|
||||
address {
|
||||
place
|
||||
city
|
||||
country
|
||||
zip
|
||||
}
|
||||
role
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_USER_BY_ID = gql`
|
||||
query GetUserById($id: String!) {
|
||||
getUserById(id: $id) {
|
||||
id
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
phone {
|
||||
prefix
|
||||
number
|
||||
}
|
||||
address {
|
||||
place
|
||||
city
|
||||
country
|
||||
zip
|
||||
}
|
||||
role
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CREATE_USER = gql`
|
||||
mutation CreateUser(
|
||||
$email: String!
|
||||
$password: String!
|
||||
$firstName: String!
|
||||
$lastName: String!
|
||||
$phone: PhoneInputModel!
|
||||
$address: AddressInputModel!
|
||||
$role: Role!
|
||||
) {
|
||||
createUser(
|
||||
email: $email
|
||||
password: $password
|
||||
firstName: $firstName
|
||||
lastName: $lastName
|
||||
phone: $phone
|
||||
address: $address
|
||||
role: $role
|
||||
) {
|
||||
id
|
||||
email
|
||||
firstName
|
||||
lastName
|
||||
phone {
|
||||
prefix
|
||||
number
|
||||
}
|
||||
address {
|
||||
place
|
||||
city
|
||||
country
|
||||
zip
|
||||
}
|
||||
role
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user