Closed HishamAli81 closed 1 year ago
I've created this PR to fix some of the type issues: https://github.com/apollographql/datasource-rest/pull/268. It's a follow up to this PR: https://github.com/apollographql/datasource-rest/pull/185 that I created & was already merged.
Problem:
There are a couple issues with the
CacheOptions
related types.First, the
RequestOptions.cacheOptions
function returns aPromise<CO | undefined>
, whereas theRESTDataSource.cacheOptionsFor()
andHttpCache.fetch()
functions both accept a function that returnsValueOrPromise<CO | undefined>
.Second, there are a number of places where the
CO
cache option generics argument is being propagated through toRequestOptions
andAugmentedRequest