ticketUpdates.api.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 TicketUpdatesDocument = gql`
  10. subscription ticketUpdates($ticketId: ID!, $initial: Boolean = false) {
  11. ticketUpdates(ticketId: $ticketId, initial: $initial) {
  12. ticket {
  13. ...ticketAttributes
  14. createArticleType {
  15. id
  16. name
  17. }
  18. mentions(first: 20) {
  19. totalCount
  20. edges {
  21. node {
  22. ...ticketMention
  23. }
  24. cursor
  25. }
  26. }
  27. checklist {
  28. id
  29. completed
  30. incomplete
  31. total
  32. complete
  33. }
  34. referencingChecklistTickets {
  35. ...referencingTicket
  36. }
  37. }
  38. }
  39. }
  40. ${TicketAttributesFragmentDoc}
  41. ${TicketMentionFragmentDoc}
  42. ${ReferencingTicketFragmentDoc}`;
  43. export function useTicketUpdatesSubscription(variables: Types.TicketUpdatesSubscriptionVariables | VueCompositionApi.Ref<Types.TicketUpdatesSubscriptionVariables> | ReactiveFunction<Types.TicketUpdatesSubscriptionVariables>, options: VueApolloComposable.UseSubscriptionOptions<Types.TicketUpdatesSubscription, Types.TicketUpdatesSubscriptionVariables> | VueCompositionApi.Ref<VueApolloComposable.UseSubscriptionOptions<Types.TicketUpdatesSubscription, Types.TicketUpdatesSubscriptionVariables>> | ReactiveFunction<VueApolloComposable.UseSubscriptionOptions<Types.TicketUpdatesSubscription, Types.TicketUpdatesSubscriptionVariables>> = {}) {
  44. return VueApolloComposable.useSubscription<Types.TicketUpdatesSubscription, Types.TicketUpdatesSubscriptionVariables>(TicketUpdatesDocument, variables, options);
  45. }
  46. export type TicketUpdatesSubscriptionCompositionFunctionResult = VueApolloComposable.UseSubscriptionReturn<Types.TicketUpdatesSubscription, Types.TicketUpdatesSubscriptionVariables>;