Socket
Socket
Sign inDemoInstall

apollo-datasource-http

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-datasource-http - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

3

dist/src/http-data-source.d.ts

@@ -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;

9

dist/src/http-data-source.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc