115 lines
2.2 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 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"])
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type GroupMutation {
create(
name: String!
2018-10-14 17:38:39 -04:00
): GroupResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
update(
id: Int!
name: String!
redirectOnLogin: String!
permissions: [String]!
pageRules: [PageRuleInput]!
2018-10-14 17:38:39 -04:00
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
delete(
id: Int!
2018-10-14 17:38:39 -04:00
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
assignUser(
groupId: Int!
userId: Int!
2018-10-14 17:38:39 -04:00
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
unassignUser(
groupId: Int!
userId: Int!
2018-10-14 17:38:39 -04:00
): DefaultResponse @auth(requires: ["write:groups", "manage:groups", "manage:system"])
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type GroupResponse {
responseResult: ResponseStatus!
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!
}
type Group {
id: Int!
name: String!
2018-10-14 17:38:39 -04:00
isSystem: Boolean!
redirectOnLogin: String
2018-10-14 17:38:39 -04:00
permissions: [String]!
pageRules: [PageRule]
2018-10-14 17:38:39 -04:00
users: [UserMinimal]
createdAt: Date!
updatedAt: Date!
}
type PageRule {
id: String!
deny: Boolean!
match: PageRuleMatch!
2019-01-12 18:33:30 -05:00
roles: [String]!
path: String!
locales: [String]!
}
input PageRuleInput {
id: String!
deny: Boolean!
match: PageRuleMatch!
2019-01-12 18:33:30 -05:00
roles: [String]!
path: String!
locales: [String]!
}
enum PageRuleMatch {
START
EXACT
END
REGEX
TAG
}