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.15.0 to 0.16.0

13

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

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

import { ResponseData } from 'undici/types/dispatcher';
import { EventEmitter, Readable } from 'stream';
import { EventEmitter } from 'stream';
import { Logger } from 'apollo-server-types';

@@ -26,14 +26,9 @@ declare type AbortSignal = unknown;

}
export declare type RequestOptions = {
context?: Dictionary<string>;
query?: Dictionary<string | number>;
body?: string | Buffer | Uint8Array | Readable | null;
headers?: Dictionary<string>;
signal?: AbortSignal;
} & CacheTTLOptions;
export declare type RequestOptions = Omit<Partial<Request>, 'origin' | 'path' | 'method'>;
export declare type Request = {
context: Dictionary<string>;
query: Dictionary<string | number>;
body: string | Buffer | Uint8Array | Readable | null;
body: any;
signal?: AbortSignal | EventEmitter | null;
json?: boolean;
origin: string;

@@ -40,0 +35,0 @@ path: string;

@@ -135,3 +135,3 @@ "use strict";

try {
const responseData = await this.pool.request({
const requestOptions = {
method: request.method,

@@ -143,3 +143,10 @@ origin: request.origin,

signal: request.signal,
});
};
if (request.json === true) {
if (requestOptions.headers['content-type'] === undefined) {
requestOptions.headers['content-type'] = 'application/json; charset=utf-8';
}
requestOptions.body = JSON.stringify(requestOptions.body);
}
const responseData = await this.pool.request(requestOptions);
responseData.body.setEncoding('utf8');

@@ -146,0 +153,0 @@ let data = '';

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

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

@@ -139,4 +139,4 @@ # Apollo HTTP Data Source

# Node.js support
## Node.js support
We test this software against **latest** major releases of the [Node.js LTS policy](https://github.com/nodejs/Release). `Current` is included to catch regression earlier.

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