wikijs-fork/server/graph/schemas/user.graphql

113 lines
2.3 KiB
GraphQL
Raw Normal View History

# ===============================================
# 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"])
search(
query: String!
2018-10-14 21:38:39 +00:00
): [UserMinimal] @auth(requires: ["write:groups", "manage:groups", "write:users", "manage:users", "manage:system"])
single(
id: Int!
2018-10-14 21:38:39 +00:00
): User @auth(requires: ["manage:users", "manage:system"])
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type UserMutation {
create(
email: String!
2019-07-29 04:50:03 +00:00
name: String!
passwordRaw: String
providerKey: String!
2019-07-29 04:50:03 +00:00
groups: [Int]!
mustChangePassword: Boolean
sendWelcomeEmail: Boolean
2018-10-14 21:38:39 +00:00
): UserResponse @auth(requires: ["write:users", "manage:users", "manage:system"])
update(
id: Int!
email: String
name: String
2019-08-17 22:29:58 +00:00
newPassword: String
groups: [Int]
location: String
jobTitle: String
timezone: String
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
delete(
id: Int!
2018-10-14 21:38:39 +00:00
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
verify(
id: Int!
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
activate(
id: Int!
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
deactivate(
id: Int!
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
resetPassword(
id: Int!
): DefaultResponse
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type UserResponse {
responseResult: ResponseStatus!
user: User
}
type UserMinimal {
id: Int!
name: String!
email: String!
providerKey: String!
isSystem: Boolean!
createdAt: Date!
}
type User {
id: Int!
name: String!
email: String!
providerKey: String!
providerId: String
isSystem: Boolean!
isActive: Boolean!
isVerified: Boolean!
location: String!
jobTitle: String!
timezone: String!
createdAt: Date!
updatedAt: Date!
groups: [Group]!
}