Files
automatisch/packages/web/src/hooks/useCurrentUser.ts
2022-04-01 00:38:54 +03:00

11 lines
327 B
TypeScript

import { useQuery } from '@apollo/client';
import { IUser } from '@automatisch/types';
import { GET_CURRENT_USER } from 'graphql/queries/get-current-user';
export default function useCurrentUser(): IUser {
const { data } = useQuery(GET_CURRENT_USER, { fetchPolicy: 'cache-and-network' });
return data?.getCurrentUser;
}