Implement eager load relations on graphqlQueries (#4391)

* Implement eager load relations on graphqlQueries

* Fix tests

* Fixes

* Fixes
This commit is contained in:
Charles Bochet
2024-03-10 23:42:23 +01:00
committed by GitHub
parent 86c0f311f5
commit ec384cc791
42 changed files with 1372 additions and 850 deletions

View File

@ -84,8 +84,77 @@ export const mocks = [
query: gql`
mutation CreateOneFavorite($input: FavoriteCreateInput!) {
createFavorite(data: $input) {
id
__typename
id
companyId
createdAt
personId
person {
__typename
xLink {
label
url
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
label
url
}
updatedAt
avatarUrl
companyId
}
position
workspaceMemberId
workspaceMember {
__typename
colorScheme
name {
firstName
lastName
}
locale
userId
avatarUrl
createdAt
updatedAt
id
}
company {
__typename
xLink {
label
url
}
linkedinLink {
label
url
}
domainName
annualRecurringRevenue {
amountMicros
currencyCode
}
createdAt
address
updatedAt
name
accountOwnerId
employees
id
idealCustomerProfile
}
updatedAt
}
}
`,
variables: {
@ -132,8 +201,77 @@ export const mocks = [
$input: FavoriteUpdateInput!
) {
updateFavorite(id: $idToUpdate, data: $input) {
id
__typename
id
companyId
createdAt
personId
person {
__typename
xLink {
label
url
}
id
createdAt
city
email
jobTitle
name {
firstName
lastName
}
phone
linkedinLink {
label
url
}
updatedAt
avatarUrl
companyId
}
position
workspaceMemberId
workspaceMember {
__typename
colorScheme
name {
firstName
lastName
}
locale
userId
avatarUrl
createdAt
updatedAt
id
}
company {
__typename
xLink {
label
url
}
linkedinLink {
label
url
}
domainName
annualRecurringRevenue {
amountMicros
currencyCode
}
createdAt
address
updatedAt
name
accountOwnerId
employees
id
idealCustomerProfile
}
updatedAt
}
}
`,
variables: {

View File

@ -25,10 +25,6 @@ jest.mock('uuid', () => ({
v4: jest.fn(() => mockId),
}));
jest.mock('@/object-metadata/hooks/useMapFieldMetadataToGraphQLQuery', () => ({
useMapFieldMetadataToGraphQLQuery: () => () => '\n',
}));
jest.mock('@/object-record/hooks/useFindManyRecords', () => ({
useFindManyRecords: () => ({ records: initialFavorites }),
}));