Releases: apollographql/datasource-rest
v6.4.1
v6.4.0
v6.3.0
v6.2.2
Patch Changes
-
#270
f6cf377Thanks @Sean-Y-X! - Use lodash'scloneDeepto clone parsed body instead ofJSON.parse(JSON.stringify(...)) -
#268
870ba80Thanks @HishamAli81! - * Fix RequestOptions.cacheOptions function return type to also return a non-promise value.- Fix propagation of the cache options generic type
RequestOptionsandAugmentedRequest.
- Fix propagation of the cache options generic type
v6.2.1
Patch Changes
d31d275Thanks @trevor-scheer! - ExportRequestDeduplicationPolicytype
v6.2.0
Minor Changes
-
#185
147f820Thanks @HishamAli81! - Added support to the RESTDatasource to be able to specify a custom cache set options type. The cache set options may need to be customized to include additional set options supported by the underlying key value cache implementation.For example, if the InMemoryLRUCache is being used to cache HTTP responses, then
noDisposeOnSet,noUpdateTTL, etc cache options can be provided to the LRU cache:import { InMemoryLRUCache } from '@apollo/utils.keyvaluecache'; interface CustomCacheOptions { ttl?: number; noDisposeOnSet?: boolean; } class ExampleDataSource extends RESTDataSource<CustomCacheOptions> { override baseURL = 'https://api.example.com'; constructor() { super({ cache: new InMemoryLRUCache() }); } getData(id: number) { return this.get(`data/${id}`, { cacheOptions: { ttl: 3600, noDisposeOnSet: true }, }); } }
v6.1.1
v6.1.0
Minor Changes
-
#242
dfb8bccThanks @trevor-scheer! - Add optionalurlparameter todidEncounterErrorshookIn previous versions of
RESTDataSource, the URL of the request was available on theRequestobject passed in to the hook. TheRequestobject is no longer passed as an argument, so this restores the availability of theurlto the hook.This is optional for now in order to keep this change forward compatible for existing
this.didEncounterErrorscall sites in userland code. In the next major version, this might become a required parameter.
v6.0.1
Patch Changes
-
#214
c7b190aThanks @trevor-scheer! - Fix bug in Cloudflare Worker usage where we try to call the.raw()method on its response headers object when it doesn't exist.For some reason, the Cloudflare Worker's global
fetchHeadersListobject is passing the instanceof check againstnode-fetch'sHeadersclass, but it doesn't have the.raw()method we expect on it. To be sure, we can just make sure it's there before we call it.
v6.0.0
Major Changes
-
#196
f8f0805Thanks @trevor-scheer! - Drop Node v14 supportTo take this major version, the only change necessary is to ensure your node runtime is using version 16.14.0 or later.
Node v14 is EOL, so we should drop support for it and upgrade packages and testing accordingly. Note this package has a dependency on
@apollo/utils.keyvaluecachewhich requires specifically node@>=16.14 due to its dependency onlru-cache.