api.ts 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. import * as Types from '@common/graphql/types';
  2. import gql from 'graphql-tag';
  3. import * as VueApolloComposable from '@vue/apollo-composable';
  4. import * as VueCompositionApi from 'vue';
  5. export type ReactiveFunction<TParam> = () => TParam;
  6. export const ObjectAttributeValuesFragmentDoc = gql`
  7. fragment objectAttributeValues on ObjectAttributeValue {
  8. attribute {
  9. name
  10. display
  11. dataType
  12. dataOption
  13. screens
  14. editable
  15. active
  16. }
  17. value
  18. }
  19. `;
  20. export const TicketsByIdDocument = gql`
  21. query ticketsById($ticketId: ID!, $withArticles: Boolean = false, $withObjectAttributes: Boolean = false) {
  22. ticketById(ticketId: $ticketId) {
  23. id
  24. number
  25. title
  26. createdAt
  27. updatedAt
  28. owner {
  29. firstname
  30. lastname
  31. }
  32. customer {
  33. firstname
  34. lastname
  35. }
  36. organization {
  37. name
  38. }
  39. state {
  40. name
  41. stateType {
  42. name
  43. }
  44. }
  45. group {
  46. name
  47. }
  48. priority {
  49. name
  50. }
  51. articles @include(if: $withArticles) {
  52. edges {
  53. node {
  54. subject
  55. }
  56. }
  57. }
  58. objectAttributeValues @include(if: $withObjectAttributes) {
  59. ...objectAttributeValues
  60. }
  61. }
  62. }
  63. ${ObjectAttributeValuesFragmentDoc}`;
  64. /**
  65. * __useTicketsByIdQuery__
  66. *
  67. * To run a query within a Vue component, call `useTicketsByIdQuery` and pass it any options that fit your needs.
  68. * When your component renders, `useTicketsByIdQuery` returns an object from Apollo Client that contains result, loading and error properties
  69. * you can use to render your UI.
  70. *
  71. * @param variables that will be passed into the query
  72. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  73. *
  74. * @example
  75. * const { result, loading, error } = useTicketsByIdQuery({
  76. * ticketId: // value for 'ticketId'
  77. * withArticles: // value for 'withArticles'
  78. * withObjectAttributes: // value for 'withObjectAttributes'
  79. * });
  80. */
  81. export function useTicketsByIdQuery(variables: Types.TicketsByIdQueryVariables | VueCompositionApi.Ref<Types.TicketsByIdQueryVariables> | ReactiveFunction<Types.TicketsByIdQueryVariables>, options: VueApolloComposable.UseQueryOptions<Types.TicketsByIdQuery, Types.TicketsByIdQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.TicketsByIdQuery, Types.TicketsByIdQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.TicketsByIdQuery, Types.TicketsByIdQueryVariables>> = {}) {
  82. return VueApolloComposable.useQuery<Types.TicketsByIdQuery, Types.TicketsByIdQueryVariables>(TicketsByIdDocument, variables, options);
  83. }
  84. export type TicketsByIdQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.TicketsByIdQuery, Types.TicketsByIdQueryVariables>;
  85. export const TicketsByOverviewDocument = gql`
  86. query ticketsByOverview($overviewId: ID!, $orderBy: TicketOrderBy, $orderDirection: OrderDirection, $cursor: String, $pageSize: Int = 10, $withObjectAttributes: Boolean = false) {
  87. ticketsByOverview(
  88. overviewId: $overviewId
  89. orderBy: $orderBy
  90. orderDirection: $orderDirection
  91. after: $cursor
  92. first: $pageSize
  93. ) {
  94. totalCount
  95. edges {
  96. node {
  97. id
  98. number
  99. title
  100. createdAt
  101. updatedAt
  102. owner {
  103. firstname
  104. lastname
  105. }
  106. customer {
  107. firstname
  108. lastname
  109. }
  110. organization {
  111. name
  112. }
  113. state {
  114. name
  115. stateType {
  116. name
  117. }
  118. }
  119. group {
  120. name
  121. }
  122. priority {
  123. name
  124. }
  125. objectAttributeValues @include(if: $withObjectAttributes) {
  126. ...objectAttributeValues
  127. }
  128. }
  129. cursor
  130. }
  131. pageInfo {
  132. endCursor
  133. hasNextPage
  134. }
  135. }
  136. }
  137. ${ObjectAttributeValuesFragmentDoc}`;
  138. /**
  139. * __useTicketsByOverviewQuery__
  140. *
  141. * To run a query within a Vue component, call `useTicketsByOverviewQuery` and pass it any options that fit your needs.
  142. * When your component renders, `useTicketsByOverviewQuery` returns an object from Apollo Client that contains result, loading and error properties
  143. * you can use to render your UI.
  144. *
  145. * @param variables that will be passed into the query
  146. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  147. *
  148. * @example
  149. * const { result, loading, error } = useTicketsByOverviewQuery({
  150. * overviewId: // value for 'overviewId'
  151. * orderBy: // value for 'orderBy'
  152. * orderDirection: // value for 'orderDirection'
  153. * cursor: // value for 'cursor'
  154. * pageSize: // value for 'pageSize'
  155. * withObjectAttributes: // value for 'withObjectAttributes'
  156. * });
  157. */
  158. export function useTicketsByOverviewQuery(variables: Types.TicketsByOverviewQueryVariables | VueCompositionApi.Ref<Types.TicketsByOverviewQueryVariables> | ReactiveFunction<Types.TicketsByOverviewQueryVariables>, options: VueApolloComposable.UseQueryOptions<Types.TicketsByOverviewQuery, Types.TicketsByOverviewQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.TicketsByOverviewQuery, Types.TicketsByOverviewQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.TicketsByOverviewQuery, Types.TicketsByOverviewQueryVariables>> = {}) {
  159. return VueApolloComposable.useQuery<Types.TicketsByOverviewQuery, Types.TicketsByOverviewQueryVariables>(TicketsByOverviewDocument, variables, options);
  160. }
  161. export type TicketsByOverviewQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.TicketsByOverviewQuery, Types.TicketsByOverviewQueryVariables>;