Files
twenty/front/src/modules/people/graphql/optimistic-effect-definitions/getPeopleOptimisticEffectDefinition.ts
Charles Bochet 7ce03ffdd1 Refactor tests command menu (#1702)
* Fix tests

* Refactor tests command menu

* Improve tests

* Fix optimistic render breaking tests
2023-09-21 11:53:36 -07:00

19 lines
399 B
TypeScript

import { Person } from '~/generated/graphql';
import { GET_PEOPLE } from '../queries/getPeople';
export const getPeopleOptimisticEffectDefinition = {
key: 'generic-entity-table-data-people',
typename: 'Person',
query: GET_PEOPLE,
resolver: ({
currentData,
newData,
}: {
currentData: Person[];
newData: Person[];
}) => {
return [...newData, ...currentData];
},
};