|
|
|
# ===============================================
|
|
|
|
# GROUPS
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
groups: GroupQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
groups: GroupMutation
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupQuery {
|
|
|
|
list(
|
|
|
|
filter: String
|
|
|
|
orderBy: String
|
|
|
|
): [GroupMinimal] @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
|
|
|
|
|
|
|
single(
|
|
|
|
id: Int!
|
|
|
|
): Group @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# MUTATIONS
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupMutation {
|
|
|
|
create(
|
|
|
|
name: String!
|
|
|
|
): GroupResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
|
|
|
|
|
|
|
update(
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
|
|
|
|
|
|
|
delete(
|
|
|
|
id: Int!
|
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
|
|
|
|
|
|
|
assignUser(
|
|
|
|
groupId: Int!
|
|
|
|
userId: Int!
|
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
|
|
|
|
|
|
|
unassignUser(
|
|
|
|
groupId: Int!
|
|
|
|
userId: Int!
|
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# TYPES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupResponse {
|
|
|
|
responseResult: ResponseStatus!
|
|
|
|
group: Group
|
|
|
|
}
|
|
|
|
|
|
|
|
type GroupMinimal {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
isSystem: Boolean!
|
|
|
|
userCount: Int
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|
|
|
|
|
|
|
|
type Group {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
isSystem: Boolean!
|
|
|
|
permissions: [String]!
|
|
|
|
pageRules: [Right]
|
|
|
|
users: [UserMinimal]
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|