We were experiencing infinite loading on field settings pages (creation of new field), due to the fact that the component was being rendered on and on and on. This was due to useGetCurrentUserQuery calls outside of the update function, causing renders in cascade. We also had an issue with the component being unmounted too often. --------- Co-authored-by: Charles Bochet <charles@twenty.com>
14 lines
373 B
TypeScript
14 lines
373 B
TypeScript
// This query cannot be put in the graphQL folder because it cannot be generated by the graphQL codegen.
|
|
import { USER_QUERY_FRAGMENT } from '@/users/graphql/fragments/userQueryFragment';
|
|
import { gql } from '@apollo/client';
|
|
|
|
export const GET_CURRENT_USER = gql`
|
|
query GetCurrentUser {
|
|
currentUser {
|
|
...UserQueryFragment
|
|
}
|
|
}
|
|
|
|
${USER_QUERY_FRAGMENT}
|
|
`;
|