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

181 lines
3.6 KiB
GraphQL
Raw Permalink 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"])
2020-03-30 05:30:10 +00:00
profile: UserProfile
2020-04-13 19:54:10 +00:00
lastLogins: [UserLastLogin] @auth(requires: ["write:groups", "manage:groups", "write:users", "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
dateFormat: String
appearance: String
2019-08-17 22:29:58 +00:00
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
delete(
id: Int!
2020-05-30 20:34:09 +00:00
replaceId: 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"])
2020-08-30 18:18:22 +00:00
enableTFA(
id: Int!
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
disableTFA(
id: Int!
): DefaultResponse @auth(requires: ["manage:users", "manage:system"])
resetPassword(
id: Int!
): DefaultResponse
updateProfile(
name: String!
location: String!
jobTitle: String!
timezone: String!
dateFormat: String!
appearance: String!
): UserTokenResponse
changePassword(
current: String!
new: String!
): UserTokenResponse
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type UserResponse {
responseResult: ResponseStatus!
user: User
}
2020-04-13 19:54:10 +00:00
type UserLastLogin {
id: Int!
name: String!
lastLoginAt: Date!
}
type UserMinimal {
id: Int!
name: String!
email: String!
providerKey: String!
isSystem: Boolean!
isActive: Boolean!
createdAt: Date!
lastLoginAt: Date
}
type User {
id: Int!
name: String!
email: String!
providerKey: String!
providerName: String
providerId: String
2020-08-30 18:18:22 +00:00
providerIs2FACapable: Boolean
isSystem: Boolean!
isActive: Boolean!
isVerified: Boolean!
location: String!
jobTitle: String!
timezone: String!
dateFormat: String!
appearance: String!
createdAt: Date!
updatedAt: Date!
2020-04-05 23:30:02 +00:00
lastLoginAt: Date
tfaIsActive: Boolean!
groups: [Group]!
}
2020-03-30 05:30:10 +00:00
type UserProfile {
id: Int!
name: String!
email: String!
providerKey: String
2020-03-30 05:30:10 +00:00
providerName: String
isSystem: Boolean!
isVerified: Boolean!
location: String!
jobTitle: String!
timezone: String!
dateFormat: String!
appearance: String!
2020-03-30 05:30:10 +00:00
createdAt: Date!
updatedAt: Date!
lastLoginAt: Date
2020-03-30 05:30:10 +00:00
groups: [String]!
pagesTotal: Int!
}
type UserTokenResponse {
responseResult: ResponseStatus!
jwt: String
2020-03-30 05:30:10 +00:00
}