Restructure project (#124)

This commit is contained in:
Charles Bochet
2023-05-17 22:31:16 +02:00
committed by GitHub
parent baca6150f5
commit 434e020846
76 changed files with 295 additions and 304 deletions

View File

@ -0,0 +1,30 @@
import { QueryResult, gql, useQuery } from '@apollo/client';
import { GraphqlQueryUser } from '../../../interfaces/entities/user.interface';
export const GET_CURRENT_USER = gql`
query GetCurrentUser($uuid: uuid) {
users(where: { id: { _eq: $uuid } }) {
id
email
displayName
workspace_member {
workspace {
id
domain_name
display_name
logo
}
}
}
}
`;
export function useGetCurrentUserQuery(userId: string | null): QueryResult<{
users: GraphqlQueryUser[];
}> {
return useQuery<{ users: GraphqlQueryUser[] }>(GET_CURRENT_USER, {
variables: {
uuid: userId,
},
});
}