wikijs-fork/server/graph/schemas/group.graphql
2018-03-26 01:11:49 -04:00

82 lines
1.2 KiB
GraphQL

# ===============================================
# GROUPS
# ===============================================
extend type Query {
groups: GroupQuery
}
extend type Mutation {
groups: GroupMutation
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type GroupQuery {
list(
filter: String
orderBy: String
): [GroupMinimal]
single(
id: String!
): Group
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type GroupMutation {
create(
name: String!
): GroupResponse
update(
id: Int!
name: String!
): GroupResponse
delete(
id: Int!
): DefaultResponse
assignUser(
groupId: Int!
userId: Int!
): DefaultResponse
unassignUser(
groupId: Int!
userId: Int!
): DefaultResponse
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type GroupResponse {
responseResult: ResponseStatus!
group: Group
}
type GroupMinimal {
id: Int!
name: String!
userCount: Int
createdAt: Date!
updatedAt: Date!
}
type Group {
id: Int!
name: String!
rights: [String]
users: [User]
createdAt: Date!
updatedAt: Date!
}