reactive-graphql
reactive-graphql copied to clipboard
[Feature] Support optional observable caching
trafficstars
Given you have two queries resolving the same item (e.g. in an array or as a single node) in the current implementation two Observables for the same entity would be created. Ideally, we would only resubscribe to an observable we already have.
For this we would need to have a similar interfaceas Relay, having a node fulfil the interface of having a unique identifier. If this interface is fulfilled we can enable caching, otherwise we do it as before. We should also have an option to globally disable this kind of caching.
I would like to export sth like this
export const CacheableSchema = `
interface Cacheable {
id: ID!
}
`;