I’m experimenting with the CraftQL plugin and React with Craft 3, and I’m really liking the similar syntax to standard Twig element queries, and the fact I don't need to manually configure API endpoints as I would if I was to set up a REST API using the ElementAPI plugin.
However, I'm not certain how I can cache data using this approach to prevent unnecessary database calls, and the scalability of such a solution.
Using a REST API I'd be able to cache the endpoints using Nginx or Varnish, but this doesn't seem to be an option using GraphQL. There seem to be several options for GraphQL application-level caching in the Node ecosystem (e.g. https://github.com/apollographql/apollo-cache-control).
Are there any options for caching database queries using the Yii Query Caching functionality (http://www.yiiframework.com/doc-2.0/guide-caching-data.html)?
Or any other techniques that may help an implementation like this scale?