Accordingly to the docs this is all it takes to query something from apollo cache but it isn't working and the console.log() is showing an empty object. The first image show that I have the entity cached.
- change
optimisticto false doesn't change the result - change the id to "141" change the return from empty object to 'null'
import gql from "graphql-tag";"apollo-client": "^2.6.8","graphql-tag": "^2.10.0",
onClick: p => {
const readFragment = apolloClient.readFragment({
id: 141,
fragment: gql`
fragment myMarca on Marca {
id
}
`,
optimistic: true,
});
console.log(readFragment);
}

