ticket.api.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import * as Types from '#shared/graphql/types.ts';
  2. import gql from 'graphql-tag';
  3. import { TicketAttributesFragmentDoc } from '../fragments/ticketAttributes.api';
  4. import { TicketMentionFragmentDoc } from '../fragments/ticketMention.api';
  5. import * as VueApolloComposable from '@vue/apollo-composable';
  6. import * as VueCompositionApi from 'vue';
  7. export type ReactiveFunction<TParam> = () => TParam;
  8. export const TicketDocument = gql`
  9. query ticket($ticketId: ID, $ticketInternalId: Int, $ticketNumber: String, $mentionsCount: Int) {
  10. ticket(
  11. ticket: {ticketId: $ticketId, ticketInternalId: $ticketInternalId, ticketNumber: $ticketNumber}
  12. ) {
  13. ...ticketAttributes
  14. createArticleType {
  15. id
  16. name
  17. }
  18. mentions(first: $mentionsCount) {
  19. totalCount
  20. edges {
  21. node {
  22. ...ticketMention
  23. }
  24. cursor
  25. }
  26. }
  27. }
  28. }
  29. ${TicketAttributesFragmentDoc}
  30. ${TicketMentionFragmentDoc}`;
  31. export function useTicketQuery(variables: Types.TicketQueryVariables | VueCompositionApi.Ref<Types.TicketQueryVariables> | ReactiveFunction<Types.TicketQueryVariables> = {}, options: VueApolloComposable.UseQueryOptions<Types.TicketQuery, Types.TicketQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.TicketQuery, Types.TicketQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.TicketQuery, Types.TicketQueryVariables>> = {}) {
  32. return VueApolloComposable.useQuery<Types.TicketQuery, Types.TicketQueryVariables>(TicketDocument, variables, options);
  33. }
  34. export function useTicketLazyQuery(variables: Types.TicketQueryVariables | VueCompositionApi.Ref<Types.TicketQueryVariables> | ReactiveFunction<Types.TicketQueryVariables> = {}, options: VueApolloComposable.UseQueryOptions<Types.TicketQuery, Types.TicketQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.TicketQuery, Types.TicketQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.TicketQuery, Types.TicketQueryVariables>> = {}) {
  35. return VueApolloComposable.useLazyQuery<Types.TicketQuery, Types.TicketQueryVariables>(TicketDocument, variables, options);
  36. }
  37. export type TicketQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.TicketQuery, Types.TicketQueryVariables>;