Fix optimistic effects to work with fragments (#1683)
* Fix optimistic effects to work with fragments * Regenerate
This commit is contained in:
@ -22,6 +22,8 @@ export const BASE_ACCOUNT_OWNER_FRAGMENT = gql`
|
||||
email
|
||||
displayName
|
||||
avatarUrl
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import { Company } from '~/generated/graphql';
|
||||
|
||||
import { GET_COMPANIES } from '../queries/getCompanies';
|
||||
import { Company, GetCompaniesDocument } from '~/generated/graphql';
|
||||
|
||||
export const getCompaniesOptimisticEffectDefinition = {
|
||||
key: 'generic-entity-table-data-companies',
|
||||
typename: 'Company',
|
||||
query: GET_COMPANIES,
|
||||
query: GetCompaniesDocument,
|
||||
resolver: ({
|
||||
currentData,
|
||||
newData,
|
||||
|
||||
@ -6,12 +6,7 @@ export const GET_COMPANIES = gql`
|
||||
$where: CompanyWhereInput
|
||||
) {
|
||||
companies: findManyCompany(orderBy: $orderBy, where: $where) {
|
||||
accountOwner {
|
||||
...baseAccountOwnerFragment
|
||||
firstName
|
||||
lastName
|
||||
}
|
||||
...baseCompanyFieldsFragment
|
||||
...companyFieldsFragment
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import { Person } from '~/generated/graphql';
|
||||
|
||||
import { GET_PEOPLE } from '../queries/getPeople';
|
||||
import { GetPeopleDocument, Person } from '~/generated/graphql';
|
||||
|
||||
export const getPeopleOptimisticEffectDefinition = {
|
||||
key: 'generic-entity-table-data-people',
|
||||
typename: 'Person',
|
||||
query: GET_PEOPLE,
|
||||
query: GetPeopleDocument,
|
||||
resolver: ({
|
||||
currentData,
|
||||
newData,
|
||||
|
||||
Reference in New Issue
Block a user