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.2 to 0.9.3

3

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

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

export declare type RequestOptions = {
query?: Dictionary<string | number>;
body?: string | Buffer | Uint8Array | Readable | null;

@@ -25,2 +26,3 @@ headers?: Dictionary<string>;

headers: Dictionary<string>;
query?: Dictionary<string | number>;
};

@@ -51,2 +53,3 @@ export declare type Response<TResult> = {

constructor(baseURL: string, options?: HTTPDataSourceOptions | undefined);
private buildQueryString;
initialize(config: DataSourceConfig<TContext>): void;

@@ -53,0 +56,0 @@ protected isResponseOk(statusCode: number): boolean;

@@ -14,2 +14,3 @@ "use strict";

const apollo_server_errors_1 = require("apollo-server-errors");
const url_1 = require("url");
function apolloKeyValueCacheToKeyv(cache) {

@@ -50,2 +51,14 @@ return {

}
buildQueryString(query) {
const params = new url_1.URLSearchParams();
for (const key in query) {
if (Object.prototype.hasOwnProperty.call(query, key)) {
const value = query[key];
if (value !== undefined) {
params.append(key, value.toString());
}
}
}
return params.toString();
}
initialize(config) {

@@ -148,2 +161,5 @@ this.context = config.context;

async request(request) {
if (request?.query) {
request.path = request.path + '?' + this.buildQueryString(request.query);
}
const cacheKey = this.onCacheKeyCalculation(request);

@@ -150,0 +166,0 @@ const ttlCacheEnabled = request.requestCache;

2

package.json
{
"name": "apollo-datasource-http",
"version": "0.9.2",
"version": "0.9.3",
"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