DenoStore brings modular and low latency caching of GraphQL queries to a Deno/Oak server.
When implementing caching of GraphQL queries there are a few main issues to consider:
- Cache becoming stale/cache invalidation
- More unique queries and results compared to REST due to granularity of GraphQL
- Lack of built-in caching support (especially for Deno)
DenoStore was built to address the above challenges and empowers users with a caching tool that is modular, efficient and quick to implement.
- Seamlessly embeds caching functionality at query resolver level, giving implementing user modular decision making power to cache specific queries and not others
- Caches resolver results rather than query results - so subsequent queries with different fields and formats can still receive existing cached values
- Leverages Redis as an in-memory low latency server-side cache
- Integrates with Oak middleware framework to handle GraphQL queries with error handling
- Provides global and resolver level expiration controls
- Makes GraphQL Playground IDE available for constructing and sending queries during development
- Supports all GraphQL query options (e.g. arguments, directives, variables, fragments)