2018-03-18 23:12:56 -04:00
|
|
|
# ===============================================
|
|
|
|
# GROUPS
|
|
|
|
# ===============================================
|
|
|
|
|
|
|
|
extend type Query {
|
|
|
|
groups: GroupQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
extend type Mutation {
|
|
|
|
groups: GroupMutation
|
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# QUERIES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupQuery {
|
|
|
|
list(
|
|
|
|
filter: String
|
|
|
|
orderBy: String
|
2018-10-14 17:38:39 -04:00
|
|
|
): [GroupMinimal] @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-26 01:11:49 -04:00
|
|
|
|
|
|
|
single(
|
2018-03-28 00:02:32 -04:00
|
|
|
id: Int!
|
2018-10-14 17:38:39 -04:00
|
|
|
): Group @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-18 23:12:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# MUTATIONS
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupMutation {
|
|
|
|
create(
|
|
|
|
name: String!
|
2018-10-14 17:38:39 -04:00
|
|
|
): GroupResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-18 23:12:56 -04:00
|
|
|
|
|
|
|
update(
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
2018-12-29 21:30:51 -05:00
|
|
|
permissions: [String]!
|
|
|
|
pageRules: [PageRuleInput]!
|
2018-10-14 17:38:39 -04:00
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-18 23:12:56 -04:00
|
|
|
|
|
|
|
delete(
|
|
|
|
id: Int!
|
2018-10-14 17:38:39 -04:00
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-18 23:12:56 -04:00
|
|
|
|
|
|
|
assignUser(
|
|
|
|
groupId: Int!
|
|
|
|
userId: Int!
|
2018-10-14 17:38:39 -04:00
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-18 23:12:56 -04:00
|
|
|
|
|
|
|
unassignUser(
|
|
|
|
groupId: Int!
|
|
|
|
userId: Int!
|
2018-10-14 17:38:39 -04:00
|
|
|
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
|
2018-03-18 23:12:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# -----------------------------------------------
|
|
|
|
# TYPES
|
|
|
|
# -----------------------------------------------
|
|
|
|
|
|
|
|
type GroupResponse {
|
2018-03-24 22:35:47 -04:00
|
|
|
responseResult: ResponseStatus!
|
2018-03-18 23:12:56 -04:00
|
|
|
group: Group
|
|
|
|
}
|
|
|
|
|
2018-03-26 01:11:49 -04:00
|
|
|
type GroupMinimal {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
2018-10-14 17:38:39 -04:00
|
|
|
isSystem: Boolean!
|
2018-03-26 01:11:49 -04:00
|
|
|
userCount: Int
|
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|
|
|
|
|
2018-03-18 23:12:56 -04:00
|
|
|
type Group {
|
|
|
|
id: Int!
|
|
|
|
name: String!
|
2018-10-14 17:38:39 -04:00
|
|
|
isSystem: Boolean!
|
|
|
|
permissions: [String]!
|
2018-12-29 21:30:51 -05:00
|
|
|
pageRules: [PageRule]
|
2018-10-14 17:38:39 -04:00
|
|
|
users: [UserMinimal]
|
2018-03-18 23:12:56 -04:00
|
|
|
createdAt: Date!
|
|
|
|
updatedAt: Date!
|
|
|
|
}
|
2018-12-29 21:30:51 -05:00
|
|
|
|
|
|
|
type PageRule {
|
|
|
|
id: String!
|
|
|
|
deny: Boolean!
|
|
|
|
match: PageRuleMatch!
|
2019-01-12 18:33:30 -05:00
|
|
|
roles: [String]!
|
2018-12-29 21:30:51 -05:00
|
|
|
path: String!
|
|
|
|
locales: [String]!
|
|
|
|
}
|
|
|
|
|
|
|
|
input PageRuleInput {
|
|
|
|
id: String!
|
|
|
|
deny: Boolean!
|
|
|
|
match: PageRuleMatch!
|
2019-01-12 18:33:30 -05:00
|
|
|
roles: [String]!
|
2018-12-29 21:30:51 -05:00
|
|
|
path: String!
|
|
|
|
locales: [String]!
|
|
|
|
}
|
|
|
|
|
|
|
|
enum PageRuleMatch {
|
|
|
|
START
|
|
|
|
EXACT
|
|
|
|
END
|
|
|
|
REGEX
|
2020-01-31 16:57:35 -05:00
|
|
|
TAG
|
2018-12-29 21:30:51 -05:00
|
|
|
}
|