3 ms·
Checkout Relay.js: https://relay.dev/ https://relay.dev/ It does a lot of client-side caching for you. The documentation is atrocious though IMO. I'm not sure
by tracyhenry 4y ago
Checkout Relay.js: https://relay.dev/ https://relay.dev/
It does a lot of client-side caching for you. The documentation is atrocious though IMO. I'm not sure if there exists a similar framework for backend caching.
- arinlen 4y ago> Checkout Relay.js: https://relay.dev/ https://relay.dev/ Relay is a GraphQL client. That's the irrelevant side of caching, because that can be trivially implemented by an intern, specially given GraphQL's official copout of caching based on primary keys [1], and doesn't have any meaningful impact on the client's resources. The relevant side of caching is server-side caching: the bits of your system that allow it to fulfill results while skipping the expensive bits, like having to hit the database. This is what really matters both in terms of operational costs and performance, and this is what GraphQL fails to deliver. [1] https://graphql.org/learn/caching/ https://graphql.org/learn/caching/
- tracyhenry 4y agohttps://relay.dev/docs/principles-and-architecture/thinking-in-graphql/ https://relay.dev/docs/principles-and-architecture/thinking-... Take a look at this. Either you didn't know what's challenging about caching nested graph data, or we have different definitions of triviality/interns.
- arinlen 4y ago> Take a look at this. I repeat: client-side caching is not a problem, even with GraphQL. The technical problems regarding GraphQL's blockers to caching lies in server-side caching. For server-side caching, the only answer that GraphQL offers is to use primary keys, hand-wave a lot, and hope that your GraphQL implementation did some sort of optimization to handle that corner case by caching results. Don't take my word for it. It's really that bad. https://graphql.org/learn/caching/ https://graphql.org/learn/caching/