feat: disable atomic operation on nestjs graphql models (#751)

* feat: no atomic

* feat: update front not atomic operations

* feat: optional fields for person model & use proper gql type

* Fix bug display name

* Fix bug update user

* Fixed bug avatar URL

* Fixed display name on people cell

* Fix lint

* Fixed storybook display name

* Fix storybook requests

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Jérémy M
2023-07-20 21:23:35 +02:00
committed by GitHub
parent 663c4d5c3f
commit 872ec9e6bb
58 changed files with 622 additions and 652 deletions

View File

@ -1,7 +1,6 @@
import { getOperationName } from '@apollo/client/utilities';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { v4 as uuidv4 } from 'uuid';
import { GET_PEOPLE } from '@/people/queries';
import { PeopleTable } from '@/people/table/components/PeopleTable';
@ -12,7 +11,7 @@ import { WithTopBarContainer } from '@/ui/layout/components/WithTopBarContainer'
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import { EntityTableActionBar } from '@/ui/table/action-bar/components/EntityTableActionBar';
import { TableContext } from '@/ui/table/states/TableContext';
import { useInsertPersonMutation } from '~/generated/graphql';
import { useInsertOnePersonMutation } from '~/generated/graphql';
const StyledTableContainer = styled.div`
display: flex;
@ -20,18 +19,12 @@ const StyledTableContainer = styled.div`
`;
export function People() {
const [insertPersonMutation] = useInsertPersonMutation();
const [insertOnePerson] = useInsertOnePersonMutation();
async function handleAddButtonClick() {
await insertPersonMutation({
await insertOnePerson({
variables: {
id: uuidv4(),
firstName: '',
lastName: '',
email: '',
phone: '',
createdAt: new Date().toISOString(),
city: '',
data: {},
},
refetchQueries: [getOperationName(GET_PEOPLE) ?? ''],
});