apollo-datasource-http
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -6,2 +6,3 @@ /// <reference types="node" /> | ||
import { EventEmitter, Readable } from 'stream'; | ||
import { Logger } from 'apollo-server-types'; | ||
declare type AbortSignal = unknown; | ||
@@ -33,2 +34,3 @@ export declare type CacheTTLOptions = { | ||
export interface HTTPDataSourceOptions { | ||
logger?: Logger; | ||
pool?: Pool; | ||
@@ -45,2 +47,3 @@ requestOptions?: RequestOptions; | ||
private pool; | ||
private logger?; | ||
private globalRequestOptions?; | ||
@@ -47,0 +50,0 @@ private readonly memoizedResults; |
@@ -47,2 +47,3 @@ "use strict"; | ||
this.globalRequestOptions = options?.requestOptions; | ||
this.logger = options?.logger; | ||
} | ||
@@ -125,4 +126,8 @@ initialize(config) { | ||
if (options.requestCache && this.isResponseCacheable(options, response)) { | ||
this.storageAdapter.set(cacheKey, response, options.requestCache?.maxTtl); | ||
this.storageAdapter.set(`staleIfError:${cacheKey}`, response, options.requestCache?.maxTtlIfError); | ||
this.storageAdapter | ||
.set(cacheKey, response, options.requestCache?.maxTtl) | ||
.catch((err) => this.logger?.error(err)); | ||
this.storageAdapter | ||
.set(`staleIfError:${cacheKey}`, response, options.requestCache?.maxTtlIfError) | ||
.catch((err) => this.logger?.error(err)); | ||
} | ||
@@ -129,0 +134,0 @@ return response; |
{ | ||
"name": "apollo-datasource-http", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"author": "Dustin Deus <deusdustin@gmail.com>", | ||
@@ -56,2 +56,3 @@ "license": "MIT", | ||
"apollo-server-errors": "^2.5.0", | ||
"apollo-server-types": "^0.9.0", | ||
"graphql": "^15.5.1", | ||
@@ -58,0 +59,0 @@ "keyv": "^4.0.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24386
241
9
+ Addedapollo-server-types@^0.9.0
+ Added@apollo/protobufjs@1.2.2(transitive)
+ Added@protobufjs/aspromise@1.1.2(transitive)
+ Added@protobufjs/base64@1.1.2(transitive)
+ Added@protobufjs/codegen@2.0.4(transitive)
+ Added@protobufjs/eventemitter@1.1.0(transitive)
+ Added@protobufjs/fetch@1.1.0(transitive)
+ Added@protobufjs/float@1.0.2(transitive)
+ Added@protobufjs/inquire@1.1.0(transitive)
+ Added@protobufjs/path@1.1.2(transitive)
+ Added@protobufjs/pool@1.1.0(transitive)
+ Added@protobufjs/utf8@1.1.0(transitive)
+ Added@types/long@4.0.2(transitive)
+ Added@types/node@10.17.60(transitive)
+ Addedapollo-reporting-protobuf@0.8.0(transitive)
+ Addedapollo-server-types@0.9.0(transitive)
+ Addedlong@4.0.0(transitive)