apollo-link-state
apollo-link-state copied to clipboard
How to read Data one object from array of objects from cache.
How to read S1 from the from the cache? I have stored the data in cache like this.
Here is my Apollo-Client
If i'm reading using Fragment's like below i'm getting data as null
You have to use the query within the function instead of the getCacheKey
.
const storyQuery = gql`
query {
story @client {
storyKey1
storyKey2
}
}
`;
const { story } = cache.readQuery({ query: storyQuery });
......