splache
v1.0.4
Published
A lightweight caching solution for GraphQL using Redis
Downloads
4
Readme
Introducing Splache (/splæʃ/), an agile, user-friendly, and lightweight JavaScript library that efficiently caches GraphQL queries using the power of Redis. The Splache library is designed for improved performance and reduced load on your GraphQL server. Through leveraging the speed and scalability of Redis, Splache is able to provide an efficient and unique solution for caching GraphQL queries!
Launch Page : Learn More about Splache & Demo our package via an interactive sandbox pre-installation
Key Features & Getting Started
1. The Caching of Whole Queries
Simply provide SpacheCacheWhole your schema, redis host, redis port, and password (Only provide the password if your external redis instance is password protected. If not, omit the password. Additionally, omit host, port, and password arguments if connecting to local redis instance) and then direct your queries through the middleware as seen in the example below.
- The Caching of Resolvers
Upon importing ResolverCache from our package, create a new instance of ResolverCache to access the ‘checkCache’ method. From there, simply wrap your resolver functions with our pre-built functionality.
Here is an example:
- The Caching of Normalized Query Strings & Breakdown of Complex Nested Queries
Create a new instance of SplacheCache, passing in your schema, host, port, and password (omit host, port, and password if just connecting to local redis instance). By passing your query through our GQLquery method, it’ll generalize and split your query string and check the cache for these individual split queries. This reduces redundancy in your cache if existing cached queries are nested into a complex nested query.
Currently Under Development
[ ]
Connect with the Team!
| Nicholas Cathcart | Nicolas Jackson | Jessica Wang | Nancy Zhang | | :---: | :---: | :---: | :---: | | | | | |
Note from the Development Team
Splache is an open-source product that is open to input and contributions from the community. After trying out the product, feel free to raise issues or submit a PR request.