fix: detach relation records in cache on record deletion (#3707)

* fix: detach relation records in cache on record deletion

* fix: fix useGetRelationMetadata tests
This commit is contained in:
Thaïs
2024-01-31 07:36:26 -03:00
committed by GitHub
parent 9597b1ae41
commit 29339ef99a
19 changed files with 465 additions and 325 deletions

View File

@ -15,6 +15,7 @@ export const useGetRecordFromCache = ({
return <CachedObjectRecord extends ObjectRecord = ObjectRecord>(
recordId: string,
cache = apolloClient.cache,
) => {
if (!objectMetadataItem) {
return null;
@ -31,7 +32,6 @@ export const useGetRecordFromCache = ({
}
`;
const cache = apolloClient.cache;
const cachedRecordId = cache.identify({
__typename: capitalize(objectMetadataItem.nameSingular),
id: recordId,