Reorganize frontend and install Craco to alias modules (#190)
This commit is contained in:
31
front/src/modules/users/services/index.tsx
Normal file
31
front/src/modules/users/services/index.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
import { gql, QueryResult, useQuery } from '@apollo/client';
|
||||
|
||||
import { GraphqlQueryUser } from '../interfaces/user.interface';
|
||||
|
||||
export const GET_CURRENT_USER = gql`
|
||||
query GetCurrentUser($uuid: String) {
|
||||
users: findManyUser(where: { id: { equals: $uuid } }) {
|
||||
id
|
||||
email
|
||||
displayName
|
||||
workspaceMember {
|
||||
workspace {
|
||||
id
|
||||
domainName
|
||||
displayName
|
||||
logo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export function useGetCurrentUserQuery(userId: string | null): QueryResult<{
|
||||
users: GraphqlQueryUser[];
|
||||
}> {
|
||||
return useQuery<{ users: GraphqlQueryUser[] }>(GET_CURRENT_USER, {
|
||||
variables: {
|
||||
uuid: userId,
|
||||
},
|
||||
});
|
||||
}
|
||||
9
front/src/modules/users/services/test.tsx
Normal file
9
front/src/modules/users/services/test.tsx
Normal file
@ -0,0 +1,9 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_CURRENT_USER = gql`
|
||||
query getUsers {
|
||||
findManyUser {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user