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.19.0 to 0.20.0

1

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

@@ -68,2 +68,3 @@ /// <reference types="node" />

protected isResponseCacheable<TResult = unknown>(request: Request, response: Response<TResult>): boolean;
protected isRequestCacheable(request: Request): boolean;
protected isRequestMemoizable(request: Request): boolean;

@@ -70,0 +71,0 @@ protected onCacheKeyCalculation(request: Request): string;

11

dist/src/http-data-source.js

@@ -60,4 +60,7 @@ "use strict";

isResponseCacheable(request, response) {
return statusCodeCacheableByDefault.has(response.statusCode) && request.method === 'GET';
return statusCodeCacheableByDefault.has(response.statusCode) && this.isRequestCacheable(request);
}
isRequestCacheable(request) {
return request.method === 'GET';
}
isRequestMemoizable(request) {

@@ -206,3 +209,4 @@ return Boolean(request.memoize) && request.method === 'GET';

const cacheKey = this.onCacheKeyCalculation(request);
if (request.method === 'GET') {
const isRequestMemoizable = this.isRequestMemoizable(request);
if (isRequestMemoizable) {
if (this.memoizedResults.has(cacheKey)) {

@@ -224,3 +228,4 @@ const response = await this.memoizedResults.get(cacheKey);

};
if (options.method === 'GET') {
const requestIsCacheable = this.isRequestCacheable(request);
if (requestIsCacheable) {
if (request.requestCache) {

@@ -227,0 +232,0 @@ try {

{
"name": "apollo-datasource-http",
"version": "0.19.0",
"version": "0.20.0",
"author": "Dustin Deus <deusdustin@gmail.com>",

@@ -5,0 +5,0 @@ "license": "MIT",

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