Skip to content

Add support for Redis and Memcached #1191

Merged
evans merged 4 commits into
version-2from
server-2.0/caching-basic
Jun 19, 2018
Merged

Add support for Redis and Memcached #1191
evans merged 4 commits into
version-2from
server-2.0/caching-basic

Conversation

@clarencenpy

@clarencenpy clarencenpy commented Jun 18, 2018

Copy link
Copy Markdown
Contributor

Refactored caching connectors for Redis/Memcached into their own packages.

  • apollo-server-caching (exports interface for KeyValueCache and test suite to share among all implementations)
  • apollo-server-memcached
  • apollo-server-redis

One issue now is that there is duplication of mocks and test code in each of the packages. It would be better if we had centralized integration tests for all cache connectors, community contributed or otherwise.

- apollo-server-caching (exports interface for KeyValueCache)
- apollo-server-caching-memcached
- apollo-server-caching-redis
One issue now is that there is duplication of mocks and test code in each of the packages. It would be better if we had centralized integration tests for all cache connectors, community contributed or otherwise.
@evans

evans commented Jun 18, 2018

Copy link
Copy Markdown
Contributor

I think we can shorten the names down to apollo-server-memcache and apollo-server-redis.

"dependencies": {
"apollo-server-env": "^2.0.0-rc.0",
"apollo-server-caching": "^2.0.0-rc.0",
"memcached": "^2.2.2"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing the types for these packages will provide a lot more confidence that we are doing the right thing.

npm install -D @types/memcached

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/redis/index.d.ts
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/memcached/index.d.ts

@clarencenpy clarencenpy force-pushed the server-2.0/caching-basic branch from a4dadf3 to 7e6d282 Compare June 18, 2018 23:02
@clarencenpy

Copy link
Copy Markdown
Contributor Author

@evans Added @types and also refactored unit tests such that they all share the same exported test suite from apollo-server-caching

@evans evans left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Let's squash it and include it in the next release 🎉

Great work @clarencenpy

@evans evans merged commit 43627ec into version-2 Jun 19, 2018
@clarencenpy clarencenpy deleted the server-2.0/caching-basic branch June 19, 2018 07:00
@evans evans mentioned this pull request Jun 21, 2018
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants