page.graphql 7.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# ===============================================
# PAGES
# ===============================================

extend type Query {
  pages: PageQuery
}

extend type Mutation {
  pages: PageMutation
}

# -----------------------------------------------
# QUERIES
# -----------------------------------------------

type PageQuery {
18 19
  history(
    id: Int!
20 21
    offsetPage: Int
    offsetSize: Int
NGPixel's avatar
NGPixel committed
22 23 24 25 26 27
  ): PageHistoryResult @auth(requires: ["manage:system", "read:history"])

  version(
    pageId: Int!
    versionId: Int!
  ): PageVersion @auth(requires: ["manage:system", "read:history"])
28 29 30 31 32 33

  search(
    query: String!
    path: String
    locale: String
  ): PageSearchResponse! @auth(requires: ["manage:system", "read:pages"])
34

35 36 37 38
  list(
    limit: Int
    orderBy: PageOrderBy
    orderByDirection: PageOrderByDirection
39 40
    tags: [String!]
    locale: String
NGPixel's avatar
NGPixel committed
41 42
    creatorId: Int
    authorId: Int
43
  ): [PageListItem!]! @auth(requires: ["manage:system", "read:pages"])
44 45 46

  single(
    id: Int!
47
  ): Page @auth(requires: ["read:pages", "manage:system"])
48 49

  tags: [PageTag]! @auth(requires: ["manage:system", "read:pages"])
50

51 52 53 54
  searchTags(
    query: String!
  ): [String]! @auth(requires: ["manage:system", "read:pages"])

55
  tree(
56 57
    path: String
    parent: Int
58 59
    mode: PageTreeMode!
    locale: String!
60
    includeAncestors: Boolean
61
  ): [PageTreeItem] @auth(requires: ["manage:system", "read:pages"])
62 63 64 65

  links(
    locale: String!
  ): [PageLinkItem] @auth(requires: ["manage:system", "read:pages"])
66 67 68 69 70

  checkConflicts(
    id: Int!
    checkoutDate: Date!
  ): Boolean! @auth(requires: ["write:pages", "manage:pages", "manage:system"])
71 72 73 74

  conflictLatest(
    id: Int!
  ): PageConflictLatest! @auth(requires: ["write:pages", "manage:pages", "manage:system"])
75 76 77 78 79 80 81 82
}

# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------

type PageMutation {
  create(
83 84 85
    content: String!
    description: String!
    editor: String!
NGPixel's avatar
NGPixel committed
86
    isPublished: Boolean!
87
    isPrivate: Boolean!
NGPixel's avatar
NGPixel committed
88
    locale: String!
89 90 91
    path: String!
    publishEndDate: Date
    publishStartDate: Date
92 93
    scriptCss: String
    scriptJs: String
94
    tags: [String]!
95
    title: String!
96
  ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
97 98 99

  update(
    id: Int!
100
    content: String
NGPixel's avatar
NGPixel committed
101 102
    description: String
    editor: String
103
    isPrivate: Boolean
NGPixel's avatar
NGPixel committed
104 105 106 107 108
    isPublished: Boolean
    locale: String
    path: String
    publishEndDate: Date
    publishStartDate: Date
109 110
    scriptCss: String
    scriptJs: String
NGPixel's avatar
NGPixel committed
111 112
    tags: [String]
    title: String
NGPixel's avatar
NGPixel committed
113 114
  ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])

NGPixel's avatar
NGPixel committed
115 116 117 118 119
  convert(
    id: Int!
    editor: String!
  ): DefaultResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])

NGPixel's avatar
NGPixel committed
120 121 122 123 124
  move(
    id: Int!
    destinationPath: String!
    destinationLocale: String!
  ): DefaultResponse @auth(requires: ["manage:pages", "manage:system"])
125 126 127

  delete(
    id: Int!
128
  ): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
Nick's avatar
Nick committed
129

130 131 132 133 134 135 136 137 138 139
  deleteTag(
    id: Int!
  ): DefaultResponse @auth(requires: ["manage:system"])

  updateTag(
    id: Int!
    tag: String!
    title: String!
  ): DefaultResponse @auth(requires: ["manage:system"])

Nick's avatar
Nick committed
140
  flushCache: DefaultResponse @auth(requires: ["manage:system"])
141

Nick's avatar
Nick committed
142 143 144
  migrateToLocale(
    sourceLocale: String!
    targetLocale: String!
145
  ): PageMigrationResponse @auth(requires: ["manage:system"])
NGPixel's avatar
NGPixel committed
146 147

  rebuildTree: DefaultResponse @auth(requires: ["manage:system"])
148 149 150 151

  render(
    id: Int!
  ): DefaultResponse @auth(requires: ["manage:system"])
NGPixel's avatar
NGPixel committed
152 153 154 155 156

  restore(
    pageId: Int!
    versionId: Int!
  ): DefaultResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
NGPixel's avatar
NGPixel committed
157 158 159 160

  purgeHistory (
    olderThan: String!
  ): DefaultResponse @auth(requires: ["manage:system"])
161 162 163 164 165 166 167 168 169 170 171
}

# -----------------------------------------------
# TYPES
# -----------------------------------------------

type PageResponse {
  responseResult: ResponseStatus!
  page: Page
}

172 173 174 175 176
type PageMigrationResponse {
  responseResult: ResponseStatus!
  count: Int
}

177 178
type Page {
  id: Int!
179 180 181 182
  path: String!
  hash: String!
  title: String!
  description: String!
183 184 185 186 187
  isPrivate: Boolean! @auth(requires: ["write:pages", "manage:system"])
  isPublished: Boolean! @auth(requires: ["write:pages", "manage:system"])
  privateNS: String @auth(requires: ["write:pages", "manage:system"])
  publishStartDate: Date! @auth(requires: ["write:pages", "manage:system"])
  publishEndDate: Date! @auth(requires: ["write:pages", "manage:system"])
188
  tags: [PageTag]!
189
  content: String! @auth(requires: ["read:source", "write:pages", "manage:system"])
190 191 192 193 194
  render: String
  toc: String
  contentType: String!
  createdAt: Date!
  updatedAt: Date!
195
  editor: String! @auth(requires: ["write:pages", "manage:system"])
196
  locale: String!
197 198 199 200 201 202 203 204
  scriptCss: String
  scriptJs: String
  authorId: Int! @auth(requires: ["write:pages", "manage:system"])
  authorName: String! @auth(requires: ["write:pages", "manage:system"])
  authorEmail: String! @auth(requires: ["write:pages", "manage:system"])
  creatorId: Int! @auth(requires: ["write:pages", "manage:system"])
  creatorName: String! @auth(requires: ["write:pages", "manage:system"])
  creatorEmail: String! @auth(requires: ["write:pages", "manage:system"])
205
}
206

207 208 209 210 211 212 213 214
type PageTag {
  id: Int!
  tag: String!
  title: String
  createdAt: Date!
  updatedAt: Date!
}

215 216
type PageHistory {
  versionId: Int!
217
  versionDate: Date!
218 219 220 221 222 223
  authorId: Int!
  authorName: String!
  actionType: String!
  valueBefore: String
  valueAfter: String
}
224

NGPixel's avatar
NGPixel committed
225 226 227 228 229 230 231
type PageVersion {
  action: String!
  authorId: String!
  authorName: String!
  content: String!
  contentType: String!
  createdAt: Date!
232
  versionDate: Date!
NGPixel's avatar
NGPixel committed
233 234 235 236 237 238 239 240 241 242 243 244 245 246
  description: String!
  editor: String!
  isPrivate: Boolean!
  isPublished: Boolean!
  locale: String!
  pageId: Int!
  path: String!
  publishEndDate: Date!
  publishStartDate: Date!
  tags: [String]!
  title: String!
  versionId: Int!
}

247 248 249 250
type PageHistoryResult {
  trail: [PageHistory]
  total: Int!
}
251 252 253 254 255 256 257 258

type PageSearchResponse {
  results: [PageSearchResult]!
  suggestions: [String]!
  totalHits: Int!
}

type PageSearchResult {
259
  id: String!
260 261 262 263 264
  title: String!
  description: String!
  path: String!
  locale: String!
}
265 266 267 268 269 270 271 272 273 274 275 276 277

type PageListItem {
  id: Int!
  path: String!
  locale: String!
  title: String
  description: String
  contentType: String!
  isPublished: Boolean!
  isPrivate: Boolean!
  privateNS: String
  createdAt: Date!
  updatedAt: Date!
278
  tags: [String]
279
}
280

281 282 283 284 285 286 287 288 289 290 291 292 293
type PageTreeItem {
  id: Int!
  path: String!
  depth: Int!
  title: String!
  isPrivate: Boolean!
  isFolder: Boolean!
  privateNS: String
  parent: Int
  pageId: Int
  locale: String!
}

294 295 296 297 298 299 300
type PageLinkItem {
  id: Int!
  path: String!
  title: String!
  links: [String]!
}

301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
type PageConflictLatest {
  id: Int!
  authorId: String!
  authorName: String!
  content: String!
  createdAt: Date!
  description: String!
  isPublished: Boolean!
  locale: String!
  path: String!
  tags: [String]
  title: String!
  updatedAt: Date!
}

316 317 318 319 320 321 322 323 324 325 326 327
enum PageOrderBy {
  CREATED
  ID
  PATH
  TITLE
  UPDATED
}

enum PageOrderByDirection {
  ASC
  DESC
}
328 329 330 331 332 333

enum PageTreeMode {
  FOLDERS
  PAGES
  ALL
}