wikijs-fork/server/graph/schemas/group.graphql

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