Skip to content
New issue

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

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

Already on GitHub? # to your account

Redis cache #17

Closed
Redirts opened this issue Apr 23, 2019 · 4 comments
Closed

Redis cache #17

Redirts opened this issue Apr 23, 2019 · 4 comments
Labels
bug Something is broken or not as expected

Comments

@Redirts
Copy link

Redirts commented Apr 23, 2019

I want to Redis for caching but it does not seem to be working. Without redis caching specified it works fine (InMemoryLRUCache).

What I did was:

import { RedisCache } from 'apollo-server-cache-redis';

//passed to ApolloServer setup:

cache: new RedisCache({
host: 'localhost',
port: 6379
}),

then I am caching with getBatchedAndCached(knexquery)

When I run it I am getting these errors:

node_redis: Deprecated: The SET command contains a argument of type Object.
This is converted to "[object Object]" by using .toString() now and will return an error from v.3.0 on.
Please handle this in your code to make sure everything works as you intended it to.
...
error: uncaughtException: ERR syntax error
ReplyError: ERR syntax error
at parseError (C:\Users\Tiago Alcobia\Documents\crossviewer-services\v2-query-service\node_modules\redis-parser\lib\parser.js:193:12)
at parseType (C:\Users\Tiago Alcobia\Documents\crossviewer-services\v2-query-service\node_modules\redis-parser\lib\parser.js:303:14)
[nodemon] app crashed - waiting for file changes before starting...

@cvburgess
Copy link
Owner

Hmm this is no bueno - what version of apollo are you using?

@cvburgess
Copy link
Owner

We swtiched to an object in this PR #16

@cvburgess cvburgess added the bug Something is broken or not as expected label Apr 24, 2019
@Redirts
Copy link
Author

Redirts commented Apr 26, 2019

Taken directly from my package.json:

"apollo-server": "^2.4.8",
"apollo-server-express": "^2.4.8",

@cvburgess
Copy link
Owner

This should be working, especially in v1 - please reopen if I am wrong!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something is broken or not as expected
Projects
None yet
Development

No branches or pull requests

2 participants