ticket.api.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 { ReferencingTicketFragmentDoc } from '../fragments/referencingTicket.api';
  6. import * as VueApolloComposable from '@vue/apollo-composable';
  7. import * as VueCompositionApi from 'vue';
  8. export type ReactiveFunction<TParam> = () => TParam;
  9. export const TicketDocument = gql`
  10. query ticket($ticketId: ID, $ticketInternalId: Int, $ticketNumber: String) {
  11. ticket(
  12. ticket: {ticketId: $ticketId, ticketInternalId: $ticketInternalId, ticketNumber: $ticketNumber}
  13. ) {
  14. ...ticketAttributes
  15. createArticleType {
  16. id
  17. name
  18. }
  19. mentions(first: 20) {
  20. totalCount
  21. edges {
  22. node {
  23. ...ticketMention
  24. }
  25. cursor
  26. }
  27. }
  28. checklist {
  29. id
  30. completed
  31. incomplete
  32. total
  33. complete
  34. }
  35. referencingChecklistTickets {
  36. ...referencingTicket
  37. }
  38. }
  39. }
  40. ${TicketAttributesFragmentDoc}
  41. ${TicketMentionFragmentDoc}
  42. ${ReferencingTicketFragmentDoc}`;
  43. 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>> = {}) {
  44. return VueApolloComposable.useQuery<Types.TicketQuery, Types.TicketQueryVariables>(TicketDocument, variables, options);
  45. }
  46. 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>> = {}) {
  47. return VueApolloComposable.useLazyQuery<Types.TicketQuery, Types.TicketQueryVariables>(TicketDocument, variables, options);
  48. }
  49. export type TicketQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.TicketQuery, Types.TicketQueryVariables>;