New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-tools/executor-http

Package Overview
Dependencies
Maintainers
4
Versions
879
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/executor-http - npm Package Compare versions

Comparing version 1.2.9-rc-56c623fbda41c608714a0570a32f7a3b9452295b to 1.2.9-rc-6540ccb0fc6251c8bc1cae48cbd933c6e5a685bd

6

CHANGELOG.md
# @graphql-tools/executor-http
## 1.2.9-rc-56c623fbda41c608714a0570a32f7a3b9452295b
## 1.2.9-rc-6540ccb0fc6251c8bc1cae48cbd933c6e5a685bd
### Patch Changes
- [#726](https://github.com/graphql-hive/gateway/pull/726) [`6334b2e`](https://github.com/graphql-hive/gateway/commit/6334b2e5d4942693121ab7d44a96fa80408aace1) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates:
- Added dependency [`@whatwg-node/promise-helpers@^1.0.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/promise-helpers/v/1.0.0) (to `dependencies`)
- [#727](https://github.com/graphql-hive/gateway/pull/727) [`c54a080`](https://github.com/graphql-hive/gateway/commit/c54a080b8b9c477ed55dd7c23fc8fcae9139bec8) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates:

@@ -8,0 +12,0 @@

98

dist/index.js
import { defaultPrintFn, serializeExecutionRequest } from '@graphql-tools/executor-common';
import { isAsyncIterable, isPromise, mapMaybePromise, createGraphQLError, inspect, mapAsyncIterator, mergeIncrementalResult, memoize1, getOperationASTFromRequest } from '@graphql-tools/utils';
import { isAsyncIterable, createGraphQLError, inspect, mapAsyncIterator, mergeIncrementalResult, memoize1, getOperationASTFromRequest } from '@graphql-tools/utils';
import { DisposableSymbols } from '@whatwg-node/disposablestack';
import { FormData, File, TextEncoder, crypto, TextDecoder, fetch } from '@whatwg-node/fetch';
import { isPromise, handleMaybePromise } from '@whatwg-node/promise-helpers';
import { ValueOrPromise } from 'value-or-promise';

@@ -20,11 +21,14 @@ import { extractFiles, isExtractableFile } from 'extract-files';

function iterate() {
return mapMaybePromise(iterator.next(), ({ value, done }) => {
if (value != null) {
values.push(value);
return handleMaybePromise(
() => iterator.next(),
({ value, done }) => {
if (value != null) {
values.push(value);
}
if (done) {
return values;
}
return iterate();
}
if (done) {
return values;
}
return iterate();
});
);
}

@@ -69,4 +73,4 @@ return iterate();

if (upload != null) {
return mapMaybePromise(
upload?.promise || upload,
return handleMaybePromise(
() => upload?.promise || upload,
(upload2) => {

@@ -77,4 +81,4 @@ const filename = upload2.filename || upload2.name || upload2.path || `blob-${indexStr}`;

} else if (isAsyncIterable(upload2)) {
return mapMaybePromise(
collectAsyncIterableValues(upload2),
return handleMaybePromise(
() => collectAsyncIterableValues(upload2),
(chunks) => {

@@ -90,4 +94,4 @@ const blobPart = new Uint8Array(chunks);

} else if (isGraphQLUpload(upload2)) {
return mapMaybePromise(
collectAsyncIterableValues(upload2.createReadStream()),
return handleMaybePromise(
() => collectAsyncIterableValues(upload2.createReadStream()),
(chunks) => {

@@ -156,4 +160,4 @@ const blobPart = new Uint8Array(chunks);

const utf8 = textEncoder.encode(str);
return mapMaybePromise(
crypto.subtle.digest("SHA-256", utf8),
return handleMaybePromise(
() => crypto.subtle.digest("SHA-256", utf8),
(hashBuffer) => {

@@ -362,21 +366,24 @@ let hashHex = "";

serializeFn = function serializeWithAPQ() {
return mapMaybePromise(hashSHA256(query), (sha256Hash) => {
const extensions = request.extensions || {};
extensions["persistedQuery"] = {
version: 1,
sha256Hash
};
return serializeExecutionRequest({
executionRequest: {
...request,
extensions
},
excludeQuery,
printFn
});
});
return handleMaybePromise(
() => hashSHA256(query),
(sha256Hash) => {
const extensions = request.extensions || {};
extensions["persistedQuery"] = {
version: 1,
sha256Hash
};
return serializeExecutionRequest({
executionRequest: {
...request,
extensions
},
excludeQuery,
printFn
});
}
);
};
}
return mapMaybePromise(
serializeFn(),
return handleMaybePromise(
() => serializeFn(),
(body) => new ValueOrPromise(() => {

@@ -407,4 +414,4 @@ switch (method) {

upstreamErrorExtensions.request.body = body;
return mapMaybePromise(
createFormDataFromVariables(body, {
return handleMaybePromise(
() => createFormDataFromVariables(body, {
File: options?.File,

@@ -544,4 +551,4 @@ FormData: options?.FormData

executor = function apqExecutor(request) {
return mapMaybePromise(
baseExecutor(request, true),
return handleMaybePromise(
() => baseExecutor(request, true),
(res) => {

@@ -576,9 +583,12 @@ if (res.errors?.some(

}
return mapMaybePromise(prevExecutor(request), (res) => {
result = res;
if (result?.errors?.length) {
return retryAttempt();
return handleMaybePromise(
() => prevExecutor(request),
(res) => {
result = res;
if (result?.errors?.length) {
return retryAttempt();
}
return result;
}
return result;
});
);
}

@@ -585,0 +595,0 @@ return retryAttempt();

{
"name": "@graphql-tools/executor-http",
"version": "1.2.9-rc-56c623fbda41c608714a0570a32f7a3b9452295b",
"version": "1.2.9-rc-6540ccb0fc6251c8bc1cae48cbd933c6e5a685bd",
"type": "module",

@@ -47,2 +47,3 @@ "description": "A set of utils for faster development of GraphQL tools",

"@whatwg-node/fetch": "^0.10.4",
"@whatwg-node/promise-helpers": "^1.0.0",
"extract-files": "^11.0.0",

@@ -49,0 +50,0 @@ "meros": "^1.2.1",

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