feat: fetch page tree resolver

This commit is contained in:
NGPixel
2019-10-07 23:38:06 -04:00
parent 38c33c58bb
commit 2a4b89859c
3 changed files with 56 additions and 0 deletions

View File

@@ -40,6 +40,12 @@ type PageQuery {
): Page @auth(requires: ["manage:pages", "delete:pages", "manage:system"])
tags: [PageTag]! @auth(requires: ["manage:system", "read:pages"])
tree(
parent: Int!
mode: PageTreeMode!
locale: String!
): [PageTreeItem] @auth(requires: ["manage:system", "read:pages"])
}
# -----------------------------------------------
@@ -182,6 +188,19 @@ type PageListItem {
tags: [String]
}
type PageTreeItem {
id: Int!
path: String!
depth: Int!
title: String!
isPrivate: Boolean!
isFolder: Boolean!
privateNS: String
parent: Int
pageId: Int
locale: String!
}
enum PageOrderBy {
CREATED
ID
@@ -194,3 +213,9 @@ enum PageOrderByDirection {
ASC
DESC
}
enum PageTreeMode {
FOLDERS
PAGES
ALL
}