You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a twitter clone app where a tweet is called a quack. I am fetching quacks with a query called "quacksForMe". The query returns a "PaginatedQuacks" entity which has the following structure..
In the cacheExchage's updates object I have a method for liking a quack in which I am trying to read fragment for the quack which has to be updated like this
const _key = cache.keyOfEntity({
__typename: "Quack",
id: quackId,
});
const _quack = cache.readFragment(
gql(`
fragment _ on Quack {
id
likes
likeStatus
}
`),
_key
);
The "_quack" is always null even though when I tried to log the whole cache in console I can see the quack object with the exact same key available in the records in cache.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am building a twitter clone app where a tweet is called a quack. I am fetching quacks with a query called "quacksForMe". The query returns a "PaginatedQuacks" entity which has the following structure..
I have a pagination for it in which the returning object's structure is like this
In the cacheExchage's updates object I have a method for liking a quack in which I am trying to read fragment for the quack which has to be updated like this
The "_quack" is always null even though when I tried to log the whole cache in console I can see the quack object with the exact same key available in the records in cache.
I am really confused as why is this not working.
Beta Was this translation helpful? Give feedback.
All reactions