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

85 lines
1.8 KiB
GraphQL
Raw Normal View History

# ===============================================
# GROUPS
# ===============================================
extend type Query {
groups: GroupQuery
}
extend type Mutation {
groups: GroupMutation
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type GroupQuery {
list(
filter: String
orderBy: String
2018-10-14 21:38:39 +00:00
): [GroupMinimal] @auth(requires: ["write:groups", "manage:groups", "manage:system"])
2018-03-26 05:11:49 +00:00
single(
2018-03-28 04:02:32 +00:00
id: Int!
2018-10-14 21:38:39 +00:00
): Group @auth(requires: ["write:groups", "manage:groups", "manage:system"])
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type GroupMutation {
create(
name: String!
2018-10-14 21:38:39 +00:00
): GroupResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
update(
id: Int!
name: String!
2018-10-14 21:38:39 +00:00
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
delete(
id: Int!
2018-10-14 21:38:39 +00:00
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
assignUser(
groupId: Int!
userId: Int!
2018-10-14 21:38:39 +00:00
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
unassignUser(
groupId: Int!
userId: Int!
2018-10-14 21:38:39 +00:00
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type GroupResponse {
responseResult: ResponseStatus!
group: Group
}
2018-03-26 05:11:49 +00:00
type GroupMinimal {
id: Int!
name: String!
2018-10-14 21:38:39 +00:00
isSystem: Boolean!
2018-03-26 05:11:49 +00:00
userCount: Int
createdAt: Date!
updatedAt: Date!
}
type Group {
id: Int!
name: String!
2018-10-14 21:38:39 +00:00
isSystem: Boolean!
permissions: [String]!
pageRules: [Right]
users: [UserMinimal]
createdAt: Date!
updatedAt: Date!
}