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

197 lines
3.7 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!
offsetPage: Int
offsetSize: Int
2019-01-12 23:33:30 +00:00
): PageHistoryResult @auth(requires: ["manage:system", "read:pages"])
2019-03-09 05:51:02 +00:00
search(
query: String!
path: String
locale: String
): PageSearchResponse! @auth(requires: ["manage:system", "read:pages"])
list(
limit: Int
orderBy: PageOrderBy
orderByDirection: PageOrderByDirection
tags: [String!]
locale: String
): [PageListItem!]! @auth(requires: ["manage:system", "read:pages"])
2019-07-02 05:48:19 +00:00
single(
id: Int!
): Page @auth(requires: ["manage:pages", "delete:pages", "manage:system"])
tags: [PageTag]! @auth(requires: ["manage:system", "read:pages"])
2018-05-20 22:50:51 +00:00
}
# -----------------------------------------------
# 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"])
2019-07-06 21:06:42 +00:00
flushCache: DefaultResponse @auth(requires: ["manage:system"])
2019-07-14 17:21:33 +00:00
migrateToLocale(
sourceLocale: String!
targetLocale: String!
): PageMigrationResponse @auth(requires: ["manage:system"])
2018-05-20 22:50:51 +00:00
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type PageResponse {
responseResult: ResponseStatus!
page: Page
}
type PageMigrationResponse {
responseResult: ResponseStatus!
count: Int
}
2018-05-20 22:50:51 +00:00
type Page {
id: Int!
2019-07-02 05:48:19 +00:00
path: String!
hash: String!
title: String!
description: String!
isPrivate: Boolean!
isPublished: Boolean!
privateNS: String
publishStartDate: Date!
publishEndDate: String!
tags: [PageTag]!
2019-07-02 05:48:19 +00:00
content: String!
render: String
toc: String
contentType: String!
createdAt: Date!
updatedAt: Date!
editor: String!
locale: String!
authorId: Int!
authorName: String!
authorEmail: String!
creatorId: Int!
creatorName: String!
creatorEmail: String!
2018-05-20 22:50:51 +00:00
}
2018-11-25 06:28:20 +00:00
type PageTag {
id: Int!
tag: String!
title: String
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!
}
type PageHistoryResult {
trail: [PageHistory]
total: Int!
}
2019-03-09 05:51:02 +00:00
type PageSearchResponse {
results: [PageSearchResult]!
suggestions: [String]!
totalHits: Int!
}
type PageSearchResult {
id: String!
2019-03-09 05:51:02 +00:00
title: String!
description: String!
path: String!
locale: String!
}
type PageListItem {
id: Int!
path: String!
locale: String!
title: String
description: String
contentType: String!
isPublished: Boolean!
isPrivate: Boolean!
privateNS: String
createdAt: Date!
updatedAt: Date!
tags: [String]
}
enum PageOrderBy {
CREATED
ID
PATH
TITLE
UPDATED
}
enum PageOrderByDirection {
ASC
DESC
}