mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
1.5 KiB
102 lines
1.5 KiB
7 years ago
|
# ===============================================
|
||
|
# USERS
|
||
|
# ===============================================
|
||
|
|
||
|
extend type Query {
|
||
|
users: UserQuery
|
||
|
}
|
||
|
|
||
|
extend type Mutation {
|
||
|
users: UserMutation
|
||
|
}
|
||
|
|
||
|
# -----------------------------------------------
|
||
|
# QUERIES
|
||
|
# -----------------------------------------------
|
||
|
|
||
|
type UserQuery {
|
||
|
list(
|
||
|
filter: String
|
||
|
orderBy: String
|
||
|
): [UserMinimal]
|
||
|
|
||
|
search(
|
||
|
query: String!
|
||
|
): [UserMinimal]
|
||
|
|
||
|
single(
|
||
|
id: Int!
|
||
|
): User
|
||
|
}
|
||
|
|
||
|
# -----------------------------------------------
|
||
|
# MUTATIONS
|
||
|
# -----------------------------------------------
|
||
|
|
||
|
type UserMutation {
|
||
|
create(
|
||
|
email: String!
|
||
|
name: String
|
||
|
passwordRaw: String
|
||
|
provider: String!
|
||
|
providerId: String
|
||
|
role: UserRole!
|
||
|
): UserResponse
|
||
|
|
||
|
update(
|
||
|
id: Int!
|
||
|
email: String
|
||
|
name: String
|
||
|
provider: String
|
||
|
providerId: String
|
||
|
role: UserRole
|
||
|
): UserResponse
|
||
|
|
||
|
delete(
|
||
|
id: Int!
|
||
|
): DefaultResponse
|
||
|
|
||
|
resetPassword(
|
||
|
id: Int!
|
||
|
): DefaultResponse
|
||
|
|
||
|
setPassword(
|
||
|
id: Int!
|
||
|
passwordRaw: String!
|
||
|
): DefaultResponse
|
||
|
}
|
||
|
|
||
|
# -----------------------------------------------
|
||
|
# TYPES
|
||
|
# -----------------------------------------------
|
||
|
|
||
|
enum UserRole {
|
||
|
guest
|
||
|
user
|
||
|
admin
|
||
|
}
|
||
|
|
||
|
type UserResponse {
|
||
|
responseResult: ResponseStatus!
|
||
|
user: User
|
||
|
}
|
||
|
|
||
|
type UserMinimal {
|
||
|
id: Int!
|
||
|
name: String!
|
||
|
email: String!
|
||
|
provider: String!
|
||
|
}
|
||
|
|
||
|
type User {
|
||
|
id: Int!
|
||
|
name: String!
|
||
|
email: String!
|
||
|
provider: String!
|
||
|
providerId: String
|
||
|
role: UserRole!
|
||
|
createdAt: Date!
|
||
|
updatedAt: Date!
|
||
|
groups: [Group]
|
||
|
}
|