2018-03-19 03:12:56 +00:00
|
|
|
# ===============================================
|
|
|
|
# GROUPS
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
groups: GroupQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
groups: GroupMutation
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupQuery {
|
|
|
|
list(
|
|
|
|
filter: String
|
|
|
|
orderBy: String
|
2018-03-26 05:11:49 +00:00
|
|
|
): [GroupMinimal]
|
|
|
|
|
|
|
|
single(
|
2018-03-28 04:02:32 +00:00
|
|
|
id: Int!
|
2018-03-26 05:11:49 +00:00
|
|
|
): Group
|
2018-03-19 03:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# 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 {
|
2018-03-25 02:35:47 +00:00
|
|
|
responseResult: ResponseStatus!
|
2018-03-19 03:12:56 +00:00
|
|
|
group: Group
|
|
|
|
}
|
|
|
|
|
2018-03-26 05:11:49 +00:00
|
|
|
type GroupMinimal {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
|
|
|
userCount: Int
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|
|
|
|
|
2018-03-19 03:12:56 +00:00
|
|
|
type Group {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
2018-03-28 04:02:32 +00:00
|
|
|
rights: [Right]
|
2018-03-19 03:12:56 +00:00
|
|
|
users: [User]
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|