Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Redis and Memcached #1191

Merged
merged 4 commits into from
Jun 19, 2018
Merged

Conversation

clarencenpy
Copy link
Contributor

@clarencenpy clarencenpy commented Jun 18, 2018

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
Copy link
Contributor

evans commented Jun 18, 2018

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
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
Copy link
Contributor Author

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

Copy link
Contributor

@evans evans left a comment

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.

None yet

2 participants