queries.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import gql from 'graphql-tag'
  3. import type {
  4. UserError,
  5. UserInput,
  6. UserSignupInput,
  7. } from '#shared/graphql/types.ts'
  8. export interface TestAvatarQuery {
  9. userCurrentAvatarActive: {
  10. id: string
  11. imageFull: string
  12. createdAt: string
  13. updatedAt: string
  14. }
  15. }
  16. export interface TestUserQuery {
  17. user: {
  18. id: string
  19. fullname: string
  20. }
  21. }
  22. export interface TestUserUpdateMutation {
  23. userUpdate: {
  24. user: {
  25. id: string
  26. fullname: string
  27. authorizations: {
  28. id: string
  29. provider: string
  30. }[]
  31. }
  32. }
  33. }
  34. export interface TestUserUpdateVariables {
  35. userId: string
  36. input: UserInput
  37. }
  38. export interface TestUserQueryVariables {
  39. userId: string
  40. }
  41. export const TestAvatarDocument = gql`
  42. query userCurrentAvatarActive {
  43. userCurrentAvatarActive {
  44. id
  45. imageFull
  46. createdAt
  47. updatedAt
  48. }
  49. }
  50. `
  51. export interface TestTicketArticlesMultipleQuery {
  52. description: {
  53. edges: {
  54. node: {
  55. id: string
  56. bodyWithUrls: string
  57. }
  58. }[]
  59. }
  60. articles: {
  61. totalCount: number
  62. edges: {
  63. node: {
  64. id: string
  65. bodyWithUrls: string
  66. }
  67. cursor: string
  68. }[]
  69. pageInfo: {
  70. endCursor: string
  71. startCursor: string
  72. hasPreviousPage: boolean
  73. }
  74. }
  75. }
  76. export const TestTicketArticlesMultiple = gql`
  77. query ticketArticles($ticketId: ID!, $beforeCursor: String) {
  78. description: ticketArticles(ticket: { ticketId: $ticketId }, first: 1) {
  79. edges {
  80. node {
  81. id
  82. bodyWithUrls
  83. }
  84. }
  85. }
  86. articles: ticketArticles(
  87. ticket: { ticketId: $ticketId }
  88. before: $beforeCursor
  89. ) {
  90. totalCount
  91. edges {
  92. node {
  93. id
  94. bodyWithUrls
  95. }
  96. cursor
  97. }
  98. pageInfo {
  99. endCursor
  100. startCursor
  101. hasPreviousPage
  102. }
  103. }
  104. }
  105. `
  106. export const TestUserDocument = gql`
  107. query user($userId: ID) {
  108. user(user: { userId: $userId }) {
  109. id
  110. fullname
  111. }
  112. }
  113. `
  114. export const TestUserUpdateDocument = gql`
  115. mutation userUpdate($userId: ID, $input: UserInput!) {
  116. userUpdate(id: $userId, input: $input) {
  117. user {
  118. id
  119. fullname
  120. authorizations {
  121. id
  122. provider
  123. }
  124. }
  125. }
  126. }
  127. `
  128. export interface TestAvatarMutation {
  129. userCurrentAvatarAdd: {
  130. avatar: {
  131. id: string
  132. imageFull: string
  133. }
  134. errors: UserError[]
  135. }
  136. }
  137. export const TestAvatarActiveMutationDocument = gql`
  138. mutation userCurrentAvatarAdd($images: AvatarInput!) {
  139. userCurrentAvatarAdd(images: $images) {
  140. avatar {
  141. id
  142. imageFull
  143. }
  144. errors {
  145. message
  146. field
  147. }
  148. }
  149. }
  150. `
  151. export interface TestUserUpdatesSubscription {
  152. userUpdates: {
  153. user: {
  154. id: string
  155. fullname: string
  156. }
  157. }
  158. }
  159. export interface TestUserUpdatesSubscriptionVariables {
  160. userId: string
  161. }
  162. export const TestUserUpdatesDocument = gql`
  163. subscription userUpdates($userId: ID!) {
  164. userUpdates(userId: $userId) {
  165. user {
  166. id
  167. fullname
  168. }
  169. }
  170. }
  171. `
  172. export interface TestAutocompleteArrayFirstLevelQuery {
  173. autocompleteSearchObjectAttributeExternalDataSource: {
  174. value: number
  175. label: string
  176. }[]
  177. }
  178. export const TestAutocompleteArrayFirstLevel = gql`
  179. query autocompleteSearchObjectAttributeExternalDataSource(
  180. $input: AutocompleteSearchObjectAttributeExternalDataSourceInput!
  181. ) {
  182. autocompleteSearchObjectAttributeExternalDataSource(input: $input) {
  183. value
  184. label
  185. }
  186. }
  187. `
  188. export const TestUserSignupMutationDocument = gql`
  189. mutation userSignup($input: UserSignupInput!) {
  190. userSignup(input: $input) {
  191. success
  192. errors {
  193. ...errors
  194. }
  195. }
  196. }
  197. `
  198. export interface TestUserSignupMutationQuery {
  199. userSignup: {
  200. success: boolean
  201. errors: UserError[] | null
  202. }
  203. }
  204. export interface TestUserSignupArgs {
  205. input: UserSignupInput
  206. }