mercurius-js / cache

Adds an in-process caching layer to Mercurius. Federation is fully supported.
MIT License
106 stars 19 forks source link

Incorrect storage invalidation option #79

Closed luke88jones closed 2 years ago

luke88jones commented 2 years ago

I believe there is a bug in the storage options object. The documentation references options.invalidation, the code base expects options.invalidate (also referenced in the TS types), and the underlying createCache() method from async-cache-dedupe expects options.invalidation.

References to the code points Storage object validation - https://github.com/mercurius-js/cache/blob/main/lib/validation.js#L152 Storage object passed directly to async-cache-dedupe - https://github.com/mercurius-js/cache/blob/main/index.js#L43 Usage in async-cache-dedupe - https://github.com/mcollina/async-cache-dedupe/blob/main/src/storage/memory.js#L30

I'm happy to raise a PR for this, just wanted to check I'm not missing something first

simone-sanfratello commented 2 years ago

thanks for spotting!