page.graphql 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. # ===============================================
  2. # PAGES
  3. # ===============================================
  4. extend type Query {
  5. pageHistoryById(
  6. id: Int!
  7. offsetPage: Int
  8. offsetSize: Int
  9. ): PageHistoryResult
  10. pageVersionById(
  11. pageId: Int!
  12. versionId: Int!
  13. ): PageVersion
  14. searchPages(
  15. """
  16. Site ID to search in (required)
  17. """
  18. siteId: UUID!
  19. """
  20. Search Query (required)
  21. """
  22. query: String!
  23. """
  24. The locale to perform the query as. Affects how the query is parsed by the search engine.
  25. """
  26. queryLocale: String
  27. """
  28. Only match pages that starts with the provided path.
  29. """
  30. path: String
  31. """
  32. Only match pages having one of the provided locales.
  33. """
  34. locale: [String]
  35. """
  36. Only match pages having one of the provided tags.
  37. """
  38. tags: [String]
  39. """
  40. Only match pages using the provided editor.
  41. """
  42. editor: String
  43. """
  44. Only match pages is the provided state.
  45. """
  46. publishState: PagePublishState
  47. """
  48. Result ordering. Defaults to relevancy.
  49. """
  50. orderBy: PageSearchSort
  51. """
  52. Result ordering direction. Defaults to descending.
  53. """
  54. orderByDirection: OrderByDirection
  55. """
  56. Result offset. Defaults to 0.
  57. """
  58. offset: Int
  59. """
  60. Results amount to return. Defaults to 25. Maximum 100.
  61. """
  62. limit: Int
  63. ): PageSearchResponse
  64. searchPagesAutocomplete(
  65. siteId: UUID!
  66. query: String!
  67. ): [String]
  68. pages(
  69. limit: Int
  70. orderBy: PageOrderBy
  71. orderByDirection: PageOrderByDirection
  72. tags: [String!]
  73. locale: String
  74. creatorId: Int
  75. authorId: Int
  76. ): [PageListItem]
  77. pageById(
  78. id: UUID!
  79. password: String
  80. ): Page
  81. pageByPath(
  82. siteId: UUID!
  83. path: String!
  84. password: String
  85. ): Page
  86. pageTree(
  87. path: String
  88. parent: Int
  89. mode: PageTreeMode!
  90. locale: String!
  91. includeAncestors: Boolean
  92. ): [PageTreeItem]
  93. pageLinks(
  94. locale: String!
  95. ): [PageLinkItem]
  96. pathFromAlias(
  97. siteId: UUID!
  98. alias: String!
  99. ): PageAliasPath
  100. tags(
  101. siteId: UUID!
  102. ): [PageTag]
  103. checkConflicts(
  104. id: Int!
  105. checkoutDate: Date!
  106. ): Boolean
  107. checkConflictsLatest(
  108. id: Int!
  109. ): PageConflictLatest
  110. }
  111. extend type Mutation {
  112. createPage(
  113. alias: String
  114. allowComments: Boolean
  115. allowContributions: Boolean
  116. allowRatings: Boolean
  117. content: String!
  118. description: String!
  119. editor: String!
  120. icon: String
  121. isBrowsable: Boolean
  122. isSearchable: Boolean
  123. locale: String!
  124. path: String!
  125. publishState: PagePublishState!
  126. publishEndDate: Date
  127. publishStartDate: Date
  128. relations: [PageRelationInput!]
  129. scriptCss: String
  130. scriptJsLoad: String
  131. scriptJsUnload: String
  132. showSidebar: Boolean
  133. showTags: Boolean
  134. showToc: Boolean
  135. siteId: UUID!
  136. tags: [String!]
  137. title: String!
  138. tocDepth: PageTocDepthInput
  139. ): PageResponse
  140. updatePage(
  141. id: UUID!
  142. patch: PageUpdateInput!
  143. ): PageResponse
  144. convertPage(
  145. id: UUID!
  146. editor: String!
  147. ): DefaultResponse
  148. renamePage(
  149. id: Int!
  150. destinationPath: String!
  151. destinationLocale: String!
  152. ): DefaultResponse
  153. deletePage(
  154. id: UUID!
  155. ): DefaultResponse
  156. deleteTag(
  157. id: Int!
  158. ): DefaultResponse
  159. updateTag(
  160. id: Int!
  161. tag: String!
  162. title: String!
  163. ): DefaultResponse
  164. flushCache: DefaultResponse
  165. migrateToLocale(
  166. sourceLocale: String!
  167. targetLocale: String!
  168. ): PageMigrationResponse
  169. rebuildPageTree: DefaultResponse
  170. renderPage(
  171. id: Int!
  172. ): DefaultResponse
  173. restorePage(
  174. pageId: Int!
  175. versionId: Int!
  176. ): DefaultResponse
  177. purgePagesHistory (
  178. olderThan: String!
  179. ): DefaultResponse
  180. }
  181. # -----------------------------------------------
  182. # TYPES
  183. # -----------------------------------------------
  184. type PageResponse {
  185. operation: Operation
  186. page: Page
  187. }
  188. type PageMigrationResponse {
  189. operation: Operation
  190. count: Int
  191. }
  192. type Page {
  193. alias: String
  194. allowComments: Boolean
  195. allowContributions: Boolean
  196. allowRatings: Boolean
  197. author: User
  198. content: String
  199. contentType: String
  200. createdAt: Date
  201. creator: User
  202. description: String
  203. editor: String
  204. hash: String
  205. icon: String
  206. id: UUID
  207. isBrowsable: Boolean
  208. isSearchable: Boolean
  209. locale: String
  210. password: String
  211. path: String
  212. publishEndDate: Date
  213. publishStartDate: Date
  214. publishState: PagePublishState
  215. relations: [PageRelation]
  216. render: String
  217. scriptJsLoad: String
  218. scriptJsUnload: String
  219. scriptCss: String
  220. showSidebar: Boolean
  221. showTags: Boolean
  222. showToc: Boolean
  223. siteId: UUID
  224. tags: [String]
  225. title: String
  226. toc: [JSON]
  227. tocDepth: PageTocDepth
  228. updatedAt: Date
  229. }
  230. type PageTag {
  231. id: UUID
  232. tag: String
  233. usageCount: Int
  234. siteId: UUID
  235. createdAt: Date
  236. updatedAt: Date
  237. }
  238. type PageHistory {
  239. versionId: Int
  240. versionDate: Date
  241. authorId: Int
  242. authorName: String
  243. actionType: String
  244. valueBefore: String
  245. valueAfter: String
  246. }
  247. type PageVersion {
  248. action: String
  249. authorId: String
  250. authorName: String
  251. content: String
  252. contentType: String
  253. createdAt: Date
  254. versionDate: Date
  255. description: String
  256. editor: String
  257. isPrivate: Boolean
  258. isPublished: Boolean
  259. locale: String
  260. pageId: Int
  261. path: String
  262. publishEndDate: Date
  263. publishStartDate: Date
  264. render: String
  265. tags: [String]
  266. title: String
  267. versionId: Int
  268. }
  269. type PageHistoryResult {
  270. trail: [PageHistory]
  271. total: Int
  272. }
  273. type PageSearchResponse {
  274. results: [PageSearchResult]
  275. totalHits: Int
  276. }
  277. type PageSearchResult {
  278. description: String
  279. highlight: String
  280. icon: String
  281. id: UUID
  282. locale: String
  283. path: String
  284. relevancy: Float
  285. tags: [String]
  286. title: String
  287. updatedAt: Date
  288. }
  289. type PageListItem {
  290. id: Int
  291. path: String
  292. locale: String
  293. title: String
  294. description: String
  295. contentType: String
  296. isPublished: Boolean
  297. isPrivate: Boolean
  298. privateNS: String
  299. createdAt: Date
  300. updatedAt: Date
  301. tags: [String]
  302. }
  303. type PageTreeItem {
  304. id: Int
  305. path: String
  306. depth: Int
  307. title: String
  308. isPrivate: Boolean
  309. isFolder: Boolean
  310. privateNS: String
  311. parent: Int
  312. pageId: Int
  313. locale: String
  314. }
  315. type PageLinkItem {
  316. id: Int
  317. path: String
  318. title: String
  319. links: [String]
  320. }
  321. type PageConflictLatest {
  322. id: Int
  323. authorId: String
  324. authorName: String
  325. content: String
  326. createdAt: Date
  327. description: String
  328. isPublished: Boolean
  329. locale: String
  330. path: String
  331. tags: [String]
  332. title: String
  333. updatedAt: Date
  334. }
  335. type PageRelation {
  336. id: UUID
  337. position: PageRelationPosition
  338. label: String
  339. caption: String
  340. icon: String
  341. target: String
  342. }
  343. input PageRelationInput {
  344. id: UUID!
  345. position: PageRelationPosition!
  346. label: String!
  347. caption: String
  348. icon: String
  349. target: String!
  350. }
  351. input PageUpdateInput {
  352. alias: String
  353. allowComments: Boolean
  354. allowContributions: Boolean
  355. allowRatings: Boolean
  356. content: String
  357. description: String
  358. icon: String
  359. isBrowsable: Boolean
  360. isSearchable: Boolean
  361. password: String
  362. publishEndDate: Date
  363. publishStartDate: Date
  364. publishState: PagePublishState
  365. reasonForChange: String
  366. relations: [PageRelationInput!]
  367. scriptJsLoad: String
  368. scriptJsUnload: String
  369. scriptCss: String
  370. showSidebar: Boolean
  371. showTags: Boolean
  372. showToc: Boolean
  373. tags: [String!]
  374. title: String
  375. tocDepth: PageTocDepthInput
  376. }
  377. type PageAliasPath {
  378. id: UUID
  379. path: String
  380. }
  381. type PageTocDepth {
  382. min: Int
  383. max: Int
  384. }
  385. input PageTocDepthInput {
  386. min: Int!
  387. max: Int!
  388. }
  389. enum PageSearchSort {
  390. relevancy
  391. title
  392. updatedAt
  393. }
  394. enum PageOrderBy {
  395. CREATED
  396. ID
  397. PATH
  398. TITLE
  399. UPDATED
  400. }
  401. enum PageOrderByDirection {
  402. ASC
  403. DESC
  404. }
  405. enum PageTreeMode {
  406. FOLDERS
  407. PAGES
  408. ALL
  409. }
  410. enum PagePublishState {
  411. draft
  412. published
  413. scheduled
  414. }
  415. enum PageRelationPosition {
  416. left
  417. center
  418. right
  419. }