login.api.ts 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. import * as Types from '#shared/graphql/types.ts';
  2. import gql from 'graphql-tag';
  3. import { SessionFragmentDoc } from '../fragments/session.api';
  4. import { ErrorsFragmentDoc } from '../fragments/errors.api';
  5. import * as VueApolloComposable from '@vue/apollo-composable';
  6. import * as VueCompositionApi from 'vue';
  7. export type ReactiveFunction<TParam> = () => TParam;
  8. export const LoginDocument = gql`
  9. mutation login($input: LoginInput!) {
  10. login(input: $input) {
  11. session {
  12. ...session
  13. }
  14. errors {
  15. ...errors
  16. }
  17. twoFactorRequired {
  18. availableTwoFactorAuthenticationMethods
  19. defaultTwoFactorAuthenticationMethod
  20. recoveryCodesAvailable
  21. }
  22. }
  23. }
  24. ${SessionFragmentDoc}
  25. ${ErrorsFragmentDoc}`;
  26. export function useLoginMutation(options: VueApolloComposable.UseMutationOptions<Types.LoginMutation, Types.LoginMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<Types.LoginMutation, Types.LoginMutationVariables>> = {}) {
  27. return VueApolloComposable.useMutation<Types.LoginMutation, Types.LoginMutationVariables>(LoginDocument, options);
  28. }
  29. export type LoginMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<Types.LoginMutation, Types.LoginMutationVariables>;