user.api.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import * as Types from '../../../../../../shared/graphql/types';
  2. import gql from 'graphql-tag';
  3. import { UserDetailAttributesFragmentDoc } from '../../../../../../shared/graphql/fragments/userDetailAttributes.api';
  4. import * as VueApolloComposable from '@vue/apollo-composable';
  5. import * as VueCompositionApi from 'vue';
  6. export type ReactiveFunction<TParam> = () => TParam;
  7. export const UserDocument = gql`
  8. query user($userId: ID, $userInternalId: Int, $secondaryOrganizationsCount: Int) {
  9. user(user: {userId: $userId, userInternalId: $userInternalId}) {
  10. ...userDetailAttributes
  11. secondaryOrganizations(first: $secondaryOrganizationsCount) {
  12. edges {
  13. node {
  14. id
  15. internalId
  16. active
  17. name
  18. }
  19. }
  20. totalCount
  21. }
  22. policy {
  23. update
  24. }
  25. }
  26. }
  27. ${UserDetailAttributesFragmentDoc}`;
  28. export function useUserQuery(variables: Types.UserQueryVariables | VueCompositionApi.Ref<Types.UserQueryVariables> | ReactiveFunction<Types.UserQueryVariables> = {}, options: VueApolloComposable.UseQueryOptions<Types.UserQuery, Types.UserQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.UserQuery, Types.UserQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.UserQuery, Types.UserQueryVariables>> = {}) {
  29. return VueApolloComposable.useQuery<Types.UserQuery, Types.UserQueryVariables>(UserDocument, variables, options);
  30. }
  31. export function useUserLazyQuery(variables: Types.UserQueryVariables | VueCompositionApi.Ref<Types.UserQueryVariables> | ReactiveFunction<Types.UserQueryVariables> = {}, options: VueApolloComposable.UseQueryOptions<Types.UserQuery, Types.UserQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.UserQuery, Types.UserQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.UserQuery, Types.UserQueryVariables>> = {}) {
  32. return VueApolloComposable.useLazyQuery<Types.UserQuery, Types.UserQueryVariables>(UserDocument, variables, options);
  33. }
  34. export type UserQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.UserQuery, Types.UserQueryVariables>;