{"id":26267194,"url":"https://github.com/oslabs-beta/splache","last_synced_at":"2025-04-30T19:08:24.298Z","repository":{"id":92700388,"uuid":"597190236","full_name":"oslabs-beta/Splache","owner":"oslabs-beta","description":"A GraphQL caching solution utilizing the speed of Redis","archived":false,"fork":false,"pushed_at":"2023-05-08T15:10:37.000Z","size":80,"stargazers_count":49,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2025-04-30T19:06:37.491Z","etag":null,"topics":["graphql","javascript","npm","npm-package","redis","redis-cache","typescript"],"latest_commit_sha":null,"homepage":"http://splachejs.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oslabs-beta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"open-source-labs","custom":["https://donorbox.org/donations-to-oslabs-inc"]}},"created_at":"2023-02-03T20:38:13.000Z","updated_at":"2025-04-08T21:38:50.000Z","dependencies_parsed_at":"2023-05-29T19:30:23.141Z","dependency_job_id":null,"html_url":"https://github.com/oslabs-beta/Splache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2FSplache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2FSplache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2FSplache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oslabs-beta%2FSplache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oslabs-beta","download_url":"https://codeload.github.com/oslabs-beta/Splache/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251767193,"owners_count":21640468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","javascript","npm","npm-package","redis","redis-cache","typescript"],"created_at":"2025-03-14T04:16:03.090Z","updated_at":"2025-04-30T19:08:24.291Z","avatar_url":"https://github.com/oslabs-beta.png","language":"TypeScript","funding_links":["https://github.com/sponsors/open-source-labs","https://donorbox.org/donations-to-oslabs-inc"],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align = 'center'\u003e\n\n\u003cimg src = 'https://i.imgur.com/P3gEOhl.png'/\u003e\n\u003ch3\u003e A Lightweight NPM package for GraphQL Caching with Redis \u003c/h3\u003e\n\n\n![GraphQL](https://img.shields.io/badge/-GraphQL-E10098?style=for-the-badge\u0026logo=graphql\u0026logoColor=white)\n![Redis](https://img.shields.io/badge/redis-%23DD0031.svg?style=for-the-badge\u0026logo=redis\u0026logoColor=white)\n [![License](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=for-the-badge)](public/LICENSE)\n\n\nIntroducing 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!\n\n\n\u003c/div\u003e\n\n\n\u003cbr/\u003e\n\u003chr/\u003e\n\n[Launch Page](www.splachejs.com) : Learn More about Splache \u0026 Demo our package via an interactive sandbox pre-installation\n\n[Install our NPM Package](https://www.npmjs.com/package/splache)\n\n[Documentation](https://medium.com/@zhangn356/exploring-caching-solutions-for-graphql-an-introduction-to-splache-4a497bdb597f)\n\n\u003chr/\u003e\n\n## Get Started and Installation\nRun ```npm install splache``` to install the package to import ```SplacheCacheWhole```, ```ResolverCache``` and ```SplacheCache```.\n\n### Quick Start with Redis\nIf you are new to Redis, here is the [documentation](https://redis.io/docs/getting-started/) to install redis and start a redis instance locally.\n\n### Import splache\n\n```node\nimport splache from 'splache'\n\n```\n\n\u003chr/\u003e\n\n## Key Features\n\n1.\u003cb\u003e The Caching of Whole Queries \u003c/b\u003e\n\n\nSimply 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. \n\n\n```node\nimport { SplacheCacheWhole }\n\nconst cache = new SplacheCacheWhole(schema, host, post, password);\n\napp.use('/graphql', cache.wholeCache, (req, res) =\u003e {\n res.send(res.locals.queryResponse) \n})\n```\n\n\n2. \u003cb\u003e The Caching of Resolvers \u003c/b\u003e\n\n```node\nimport { ResolverCache } from 'Splache' \n\nconst cache = new ResolverCache(host, port, password) \n```\n\nUpon 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.\n\nHere is an example:\n\n\n```node\nplanet : {\n  type: Planet,\n  args: {\n   id : {\n     description: 'id of the planet'\n     type: new GraphQLNonNull(GraphQLString)\n  }\n },\n resolve: ((parent, args, context, info) =\u003e cache.checkCache(parents, args, context, info, getPlanet))\n}\n```\n\n\n3. \u003cb\u003e The Caching of Normalized Query Strings \u0026 Breakdown of Complex Nested Queries \u003c/b\u003e\n\nCreate 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. \n\n\n```node\nimport { SplacheCache } from 'splache' \nconst cache = newSplacheCache(schema, host, port, password);\n\napp.use('/graphql', cacheGQLquery, (req, res) =\u003e {\n  res.send(res.locals.queryResponse)\n})\n```\n\n## Currently Under Development\n\n\n## Connect with the Team!\n| Nicholas Cathcart | Nicolas Jackson | Jessica Wang | Nancy Zhang |\n| :---: | :---: | :---: | :---: |\n| [![GitHub](https://skillicons.dev/icons?i=github)](https://github.com/nhcathcart) [![LinkedIn](https://skillicons.dev/icons?i=linkedin)](https://www.linkedin.com/in/nicholas-cathcart-4b3834267/)| [![GitHub](https://skillicons.dev/icons?i=github)](https://github.com/NicJax) [![LinkedIn](https://skillicons.dev/icons?i=linkedin)](www.linkedin.com/in/NicJax) | [![GitHub](https://skillicons.dev/icons?i=github)](https://github.com/jesswang-dev) [![LinkedIn](https://skillicons.dev/icons?i=linkedin)](https://www.linkedin.com/in/jessica-xuecen-wang) | [![GitHub](https://skillicons.dev/icons?i=github)](https://github.com/zhangn356 ) [![LinkedIn](https://skillicons.dev/icons?i=linkedin)](https://www.linkedin.com/in/zhangn356) |\n\n## Want to Contribute?\n\nSplache 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foslabs-beta%2Fsplache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foslabs-beta%2Fsplache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foslabs-beta%2Fsplache/lists"}