2018-05-12 20:13:04 +00:00
|
|
|
# ===============================================
|
|
|
|
# USERS
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
users: UserQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
users: UserMutation
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type UserQuery {
|
|
|
|
list(
|
|
|
|
filter: String
|
|
|
|
orderBy: String
|
2018-10-14 21:38:39 +00:00
|
|
|
): [UserMinimal] @auth(requires: ["write:users", "manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
search(
|
|
|
|
query: String!
|
2018-10-14 21:38:39 +00:00
|
|
|
): [UserMinimal] @auth(requires: ["write:groups", "manage:groups", "write:users", "manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
single(
|
|
|
|
id: Int!
|
2018-10-14 21:38:39 +00:00
|
|
|
): User @auth(requires: ["manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# MUTATIONS
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type UserMutation {
|
|
|
|
create(
|
|
|
|
email: String!
|
|
|
|
name: String
|
|
|
|
passwordRaw: String
|
|
|
|
provider: String!
|
|
|
|
providerId: String
|
|
|
|
role: UserRole!
|
2018-10-14 21:38:39 +00:00
|
|
|
): UserResponse @auth(requires: ["write:users", "manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
update(
|
|
|
|
id: Int!
|
|
|
|
email: String
|
|
|
|
name: String
|
|
|
|
provider: String
|
|
|
|
providerId: String
|
|
|
|
role: UserRole
|
2018-10-14 21:38:39 +00:00
|
|
|
): UserResponse @auth(requires: ["manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
delete(
|
|
|
|
id: Int!
|
2018-10-14 21:38:39 +00:00
|
|
|
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
|
2018-05-12 20:13:04 +00:00
|
|
|
|
|
|
|
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!
|
2018-08-05 15:27:46 +00:00
|
|
|
providerKey: String!
|
2018-10-14 03:22:42 +00:00
|
|
|
createdAt: Date!
|
2018-05-12 20:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type User {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
email: String!
|
2018-08-05 15:27:46 +00:00
|
|
|
providerKey: String!
|
2018-05-12 20:13:04 +00:00
|
|
|
providerId: String
|
|
|
|
role: UserRole!
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
groups: [Group]
|
|
|
|
}
|