searchOverview.api.ts 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import * as Types from '#shared/graphql/types.ts';
  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 SearchDocument = gql`
  7. query search($search: String!, $onlyIn: EnumSearchableModels, $limit: Int = 30) {
  8. search(search: $search, onlyIn: $onlyIn, limit: $limit) {
  9. ... on Ticket {
  10. id
  11. internalId
  12. title
  13. number
  14. state {
  15. id
  16. name
  17. }
  18. priority {
  19. name
  20. defaultCreate
  21. uiColor
  22. }
  23. customer {
  24. id
  25. internalId
  26. fullname
  27. }
  28. updatedAt
  29. updatedBy {
  30. id
  31. fullname
  32. }
  33. stateColorCode
  34. }
  35. ... on User {
  36. id
  37. internalId
  38. firstname
  39. lastname
  40. image
  41. active
  42. outOfOffice
  43. outOfOfficeStartAt
  44. outOfOfficeEndAt
  45. vip
  46. organization {
  47. id
  48. internalId
  49. name
  50. }
  51. updatedAt
  52. updatedBy {
  53. id
  54. fullname
  55. }
  56. ticketsCount {
  57. open
  58. closed
  59. }
  60. }
  61. ... on Organization {
  62. id
  63. internalId
  64. members(first: 2) {
  65. edges {
  66. node {
  67. id
  68. fullname
  69. }
  70. }
  71. totalCount
  72. }
  73. active
  74. name
  75. vip
  76. updatedAt
  77. updatedBy {
  78. id
  79. fullname
  80. }
  81. ticketsCount {
  82. open
  83. closed
  84. }
  85. }
  86. }
  87. }
  88. `;
  89. export function useSearchQuery(variables: Types.SearchQueryVariables | VueCompositionApi.Ref<Types.SearchQueryVariables> | ReactiveFunction<Types.SearchQueryVariables>, options: VueApolloComposable.UseQueryOptions<Types.SearchQuery, Types.SearchQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.SearchQuery, Types.SearchQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.SearchQuery, Types.SearchQueryVariables>> = {}) {
  90. return VueApolloComposable.useQuery<Types.SearchQuery, Types.SearchQueryVariables>(SearchDocument, variables, options);
  91. }
  92. export function useSearchLazyQuery(variables?: Types.SearchQueryVariables | VueCompositionApi.Ref<Types.SearchQueryVariables> | ReactiveFunction<Types.SearchQueryVariables>, options: VueApolloComposable.UseQueryOptions<Types.SearchQuery, Types.SearchQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.SearchQuery, Types.SearchQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.SearchQuery, Types.SearchQueryVariables>> = {}) {
  93. return VueApolloComposable.useLazyQuery<Types.SearchQuery, Types.SearchQueryVariables>(SearchDocument, variables, options);
  94. }
  95. export type SearchQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.SearchQuery, Types.SearchQueryVariables>;