{"id":16527531,"url":"https://github.com/intellicode/graphql-resolver-cache","last_synced_at":"2026-04-02T15:59:33.793Z","repository":{"id":57253589,"uuid":"100203287","full_name":"Intellicode/graphql-resolver-cache","owner":"Intellicode","description":"Caching for Graphql Resolvers","archived":false,"fork":false,"pushed_at":"2019-11-21T01:37:11.000Z","size":3060,"stargazers_count":19,"open_issues_count":11,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-25T09:00:28.434Z","etag":null,"topics":["apollo-server","apollographql","graphql","graphql-js"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Intellicode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-13T20:38:53.000Z","updated_at":"2023-08-19T22:36:10.000Z","dependencies_parsed_at":"2022-08-31T22:20:34.176Z","dependency_job_id":null,"html_url":"https://github.com/Intellicode/graphql-resolver-cache","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellicode%2Fgraphql-resolver-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellicode%2Fgraphql-resolver-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellicode%2Fgraphql-resolver-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellicode%2Fgraphql-resolver-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Intellicode","download_url":"https://codeload.github.com/Intellicode/graphql-resolver-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130232,"owners_count":20402754,"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":["apollo-server","apollographql","graphql","graphql-js"],"created_at":"2024-10-11T17:35:50.653Z","updated_at":"2025-10-25T06:01:52.358Z","avatar_url":"https://github.com/Intellicode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nGraphql resolver cache\n==============================\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/Intellicode/graphql-resolver-cache.svg)](https://greenkeeper.io/)\n\n[![Maintenance Status][status-image]][status-url] [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][deps-image]][deps-url] [![Coverage Status][coverage-image]][coverage-url] [![Code Climate][climate-image]][climate-url] [![BCH compliance][bettercode-image]][bettercode-url] \n\nEasy wrapper around resolvers to cache results based on root elements and Graphql query arguments. Works best with Apollo Graphql.\n\n# Installation\n\n```sh\n$ npm install graphql-resolver-cache --save\n```\n\n# Configuration\n\nAdd a cache to your Graphql middleware:\n\n```js\nimport express from 'express';\nimport bodyParser from 'body-parser';\nimport { graphqlExpress } from 'apollo-server-express';\nimport { LruCache } from 'graphql-resolver-cache';\n\nconst myGraphQLSchema = // ... define or import your schema here!\nconst PORT = 3000;\n\nconst app = express();\nconst resolverCache = new LruCache();\n\n// bodyParser is needed just for POST.\napp.use('/graphql', bodyParser.json(), graphqlExpress({ \n  schema: myGraphQLSchema,\n  context: { resolverCache }\n}));\n\napp.listen(PORT);\n```\n\nWrap your resolver in a cache function:\n\n```js\nimport { withCache } from 'graphql-resolver-cache';\nexport default {\n  User: {\n    getFriends: withCache((root, args, context) =\u003e { /* logic */ }),\n  },\n};\n```\n\n[npm-url]: https://npmjs.org/package/graphql-resolver-cache\n[npm-image]: http://img.shields.io/npm/v/graphql-resolver-cache.svg?style=flat-square\n\n[travis-url]: https://travis-ci.org/Intellicode/graphql-resolver-cache\n[travis-image]: http://img.shields.io/travis/Intellicode/graphql-resolver-cache/master.svg?style=flat-square\n\n[deps-url]: https://david-dm.org/Intellicode/graphql-resolver-cache\n[deps-image]: https://img.shields.io/david/dev/Intellicode/graphql-resolver-cache.svg?style=flat-square\n\n[coverage-url]: https://coveralls.io/r/Intellicode/graphql-resolver-cache?branch=master\n[coverage-image]: http://img.shields.io/coveralls/Intellicode/graphql-resolver-cache/master.svg?style=flat-square\n\n[climate-url]: https://codeclimate.com/github/Intellicode/graphql-resolver-cache\n[climate-image]: http://img.shields.io/codeclimate/github/Intellicode/graphql-resolver-cache.svg?style=flat-square\n\n[status-url]: https://github.com/Intellicode/graphql-resolver-cache/pulse\n[status-image]: http://img.shields.io/badge/status-maintained-brightgreen.svg?style=flat-square\n\n[bettercode-image]: https://bettercodehub.com/edge/badge/Intellicode/graphql-resolver-cache\n[bettercode-url]: https://bettercodehub.com\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintellicode%2Fgraphql-resolver-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintellicode%2Fgraphql-resolver-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintellicode%2Fgraphql-resolver-cache/lists"}