Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sroebert committed Oct 7, 2024
1 parent 70f3c73 commit 7f71260
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/keyvAdapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ In Apollo Server v3:
import { ApolloServer } from "apollo-server";
import { KeyvAdapter } from "@apollo/utils.keyvadapter";
import Keyv from "keyv";
import KeyvRedis from "@keyv/redis";

new ApolloServer({
cache: new KeyvAdapter(new Keyv("redis://...")),
cache: new KeyvAdapter(new Keyv({ store: new KeyvRedis("redis://...") })),
});
```

Expand All @@ -30,9 +31,10 @@ In Apollo Server v4:
import { ApolloServer } from "@apollo/server";
import { KeyvAdapter } from "@apollo/utils.keyvadapter";
import Keyv from "keyv";
import KeyvRedis from "@keyv/redis";

new ApolloServer({
cache: new KeyvAdapter(new Keyv("redis://...")),
cache: new KeyvAdapter(new Keyv({ store: new KeyvRedis("redis://...") })),
});
```

Expand All @@ -49,6 +51,8 @@ By default, `KeyvAdapter` will use [`DataLoader`'s batching functionality](https

```ts
new ApolloServer({
cache: new KeyvAdapter(new Keyv("redis://..."), { disableBatchReads: true }),
cache: new KeyvAdapter(new Keyv({ store: new KeyvRedis("redis://...") }), {
disableBatchReads: true,
}),
});
```

0 comments on commit 7f71260

Please sign in to comment.