The problem is that "data" is always new object. It will cause re-render of react child components and triggers useMemo,useCallback recalculation. Event if data is absolutelly the same by value.
If Apollo takes data from cache, is'nt they will always be the same?
const { data } = useQuery(scheme); // new data on each render
const { data } = useQuery(scheme, { fetchPolicy: 'cache-only', }); // new data on each render
i couldn't find any info about this in docs, so decided to ask here.
Is this a proper behaviour, or its some bug in my project?
UPD: I have noticed that in Component1 apollo retuns same data object, if it was not changed, but in some cases in Component2 it will return always new data object.
Objects are absolutely same by value and i still trying to figure out how to reproduce that...