Skip to content

Commit

Permalink
types: Optionality of cache on PersistedQueryOptions.
Browse files Browse the repository at this point in the history
The `cache` value is not required to be passed inside of `persistedQueries`
(the top-level object that's passed to Apollo Server's constructor options
to configure the APQ cache).  When it's omitted, it defaults to the (global)
`cache` also passed at the very top-level of the same constructor options.

This wasn't usually a problem in the past, but now that there are other
adjacent properties (like the `ttl` property introduced to control the
default TTL for APQ; #3623)
this has made it desirable to drop off the `cache` entirely and only pass
`ttl`.
  • Loading branch information
abernix committed Feb 14, 2020
1 parent a94f403 commit 88ac42e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/graphqlOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export type DataSources<TContext> = {
};

export interface PersistedQueryOptions {
cache: KeyValueCache;
cache?: KeyValueCache;
/**
* Specified in **seconds**, this time-to-live (TTL) value limits the lifespan
* of how long the persisted query should be cached. To specify a desired
Expand Down

0 comments on commit 88ac42e

Please sign in to comment.