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

110 lines
2.0 KiB
GraphQL
Raw Normal View History

2018-05-20 22:50:51 +00:00
# ===============================================
# PAGES
# ===============================================
extend type Query {
pages: PageQuery
}
extend type Mutation {
pages: PageMutation
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type PageQuery {
2018-11-25 06:28:20 +00:00
history(
id: Int!
offset: Int
): [PageHistory]
2018-05-20 22:50:51 +00:00
list(
filter: String
orderBy: String
): [PageMinimal]
single(
2018-07-22 04:29:39 +00:00
id: Int
path: String
locale: String
isPrivate: Boolean
2018-05-20 22:50:51 +00:00
): Page
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type PageMutation {
create(
content: String!
description: String!
editor: String!
2018-07-22 04:29:39 +00:00
isPublished: Boolean!
isPrivate: Boolean!
2018-07-22 04:29:39 +00:00
locale: String!
2018-05-20 22:50:51 +00:00
path: String!
publishEndDate: Date
publishStartDate: Date
tags: [String]!
2018-05-20 22:50:51 +00:00
title: String!
2018-10-14 21:38:39 +00:00
): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
2018-05-20 22:50:51 +00:00
update(
id: Int!
content: String
2018-07-22 04:29:39 +00:00
description: String
editor: String
isPrivate: Boolean
2018-07-22 04:29:39 +00:00
isPublished: Boolean
locale: String
path: String
publishEndDate: Date
publishStartDate: Date
tags: [String]
title: String
2018-10-14 21:38:39 +00:00
): PageResponse @auth(requires: ["manage:pages", "manage:system"])
2018-05-20 22:50:51 +00:00
delete(
id: Int!
2018-10-14 21:38:39 +00:00
): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
2018-05-20 22:50:51 +00:00
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type PageResponse {
responseResult: ResponseStatus!
page: Page
}
type PageMinimal {
id: Int!
name: String!
userCount: Int
createdAt: Date!
updatedAt: Date!
}
type Page {
id: Int!
name: String!
rights: [Right]
users: [User]
createdAt: Date!
updatedAt: Date!
}
2018-11-25 06:28:20 +00:00
type PageHistory {
versionId: Int!
authorId: Int!
authorName: String!
actionType: String!
valueBefore: String
valueAfter: String
createdAt: Date!
}