queries.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. package wikijs
  2. const searchPagesQuery = `query SearchPages($query: String!, $path: String, $locale: String) {
  3. pages {
  4. search(query: $query, path: $path, locale: $locale) {
  5. results {
  6. title
  7. description
  8. path
  9. locale
  10. }
  11. suggestions
  12. totalHits
  13. }
  14. }
  15. }`
  16. const pageByIDQuery = `query GetPageById($id: Int!) {
  17. pages {
  18. single(id: $id) {
  19. id
  20. path
  21. title
  22. description
  23. tags {
  24. tag
  25. title
  26. }
  27. content
  28. createdAt
  29. updatedAt
  30. locale
  31. }
  32. }
  33. }`
  34. const pageByPathQuery = `query GetPageByPath($path: String!, $locale: String!) {
  35. pages {
  36. singleByPath(path: $path, locale: $locale) {
  37. id
  38. path
  39. title
  40. description
  41. content
  42. createdAt
  43. updatedAt
  44. locale
  45. tags {
  46. tag
  47. title
  48. }
  49. }
  50. }
  51. }`
  52. const listPagesQuery = `query GetAllPages($limit: Int, $locale: String, $tags: [String!]) {
  53. pages {
  54. list(limit: $limit, locale: $locale, tags: $tags) {
  55. id
  56. path
  57. locale
  58. title
  59. description
  60. createdAt
  61. updatedAt
  62. tags
  63. }
  64. }
  65. }`
  66. const listAssetFoldersQuery = `query ListAssetFolders($parentFolderId: Int!) {
  67. assets {
  68. folders(parentFolderId: $parentFolderId) {
  69. id
  70. slug
  71. name
  72. }
  73. }
  74. }`
  75. const listAssetsQuery = `query ListAssets($folderId: Int!, $kind: AssetKind!) {
  76. assets {
  77. list(folderId: $folderId, kind: $kind) {
  78. id
  79. filename
  80. ext
  81. kind
  82. mime
  83. fileSize
  84. createdAt
  85. updatedAt
  86. folder {
  87. id
  88. slug
  89. name
  90. }
  91. }
  92. }
  93. }`
  94. const createAssetFolderMutation = `mutation CreateAssetFolder(
  95. $parentFolderId: Int!
  96. $slug: String!
  97. $name: String!
  98. ) {
  99. assets {
  100. createFolder(
  101. parentFolderId: $parentFolderId
  102. slug: $slug
  103. name: $name
  104. ) {
  105. responseResult {
  106. succeeded
  107. errorCode
  108. slug
  109. message
  110. }
  111. }
  112. }
  113. }`
  114. const createPageMutation = `mutation CreatePage(
  115. $title: String!
  116. $content: String!
  117. $description: String!
  118. $editor: String!
  119. $isPublished: Boolean!
  120. $isPrivate: Boolean!
  121. $locale: String!
  122. $tags: [String]!
  123. $path: String!
  124. ) {
  125. pages {
  126. create(
  127. title: $title
  128. content: $content
  129. description: $description
  130. editor: $editor
  131. isPublished: $isPublished
  132. isPrivate: $isPrivate
  133. locale: $locale
  134. tags: $tags
  135. path: $path
  136. ) {
  137. responseResult {
  138. succeeded
  139. errorCode
  140. slug
  141. message
  142. }
  143. }
  144. }
  145. }`
  146. const updatePageMutation = `mutation UpdatePage(
  147. $id: Int!
  148. $title: String!
  149. $content: String!
  150. $description: String!
  151. $editor: String!
  152. $isPublished: Boolean!
  153. $isPrivate: Boolean!
  154. $locale: String!
  155. $tags: [String]!
  156. $path: String!
  157. ) {
  158. pages {
  159. update(
  160. id: $id
  161. title: $title
  162. content: $content
  163. description: $description
  164. editor: $editor
  165. isPublished: $isPublished
  166. isPrivate: $isPrivate
  167. locale: $locale
  168. tags: $tags
  169. path: $path
  170. ) {
  171. responseResult {
  172. succeeded
  173. errorCode
  174. slug
  175. message
  176. }
  177. }
  178. }
  179. }`