api.ts 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 TicketsByOverviewDocument = gql`
  21. query ticketsByOverview($overviewId: ID!, $orderBy: TicketOrderBy, $orderDirection: OrderDirection, $cursor: String, $pageSize: Int = 10) {
  22. ticketsByOverview(
  23. overviewId: $overviewId
  24. orderBy: $orderBy
  25. orderDirection: $orderDirection
  26. after: $cursor
  27. first: $pageSize
  28. ) {
  29. totalCount
  30. edges {
  31. node {
  32. id
  33. number
  34. title
  35. createdAt
  36. updatedAt
  37. owner {
  38. firstname
  39. lastname
  40. }
  41. customer {
  42. firstname
  43. lastname
  44. }
  45. organization {
  46. name
  47. }
  48. state {
  49. name
  50. stateTypeName
  51. }
  52. group {
  53. name
  54. }
  55. priority {
  56. name
  57. }
  58. objectAttributeValues {
  59. ...objectAttributeValues
  60. }
  61. }
  62. cursor
  63. }
  64. pageInfo {
  65. endCursor
  66. hasNextPage
  67. }
  68. }
  69. }
  70. ${ObjectAttributeValuesFragmentDoc}`;
  71. /**
  72. * __useTicketsByOverviewQuery__
  73. *
  74. * To run a query within a Vue component, call `useTicketsByOverviewQuery` and pass it any options that fit your needs.
  75. * When your component renders, `useTicketsByOverviewQuery` returns an object from Apollo Client that contains result, loading and error properties
  76. * you can use to render your UI.
  77. *
  78. * @param variables that will be passed into the query
  79. * @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
  80. *
  81. * @example
  82. * const { result, loading, error } = useTicketsByOverviewQuery({
  83. * overviewId: // value for 'overviewId'
  84. * orderBy: // value for 'orderBy'
  85. * orderDirection: // value for 'orderDirection'
  86. * cursor: // value for 'cursor'
  87. * pageSize: // value for 'pageSize'
  88. * });
  89. */
  90. 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>> = {}) {
  91. return VueApolloComposable.useQuery<Types.TicketsByOverviewQuery, Types.TicketsByOverviewQueryVariables>(TicketsByOverviewDocument, variables, options);
  92. }
  93. export type TicketsByOverviewQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.TicketsByOverviewQuery, Types.TicketsByOverviewQueryVariables>;