searchOverview.api.ts 2.8 KB

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