Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-tools/executor-http

Package Overview
Dependencies
Maintainers
4
Versions
589
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.2 to 1.2.3-alpha-eeb5a1d4d585f1315b38da3d023b25283b3ac051

6

CHANGELOG.md
# @graphql-tools/executor-http
## 1.2.3-alpha-eeb5a1d4d585f1315b38da3d023b25283b3ac051
### Patch Changes
- [#376](https://github.com/graphql-hive/gateway/pull/376) [`eeb5a1d`](https://github.com/graphql-hive/gateway/commit/eeb5a1d4d585f1315b38da3d023b25283b3ac051) Thanks [@ardatan](https://github.com/ardatan)! - No need to handle event listeners inside HTTP Executor thanks to the improvements with `@graphql-tools/utils`'s `registerAbortSignalListener` to avoid Node.js warnings when multiple event listeners registered to an `AbortSignal`
## 1.2.2

@@ -4,0 +10,0 @@

29

dist/index.js

@@ -286,25 +286,8 @@ import { abortSignalAny } from '@graphql-hive/gateway-abort-signal-any';

function createSignalWrapper(signal) {
const listeners = /* @__PURE__ */ new Set();
signal.onabort = (event) => {
for (const listener of listeners) {
listener(event);
}
};
return Object.assign(signal, {
addEventListener(_type, listener) {
listeners.add(listener);
},
removeEventListener(_type, listener) {
listeners.delete(listener);
}
});
}
function buildHTTPExecutor(options) {
const printFn = options?.print ?? defaultPrintFn;
const disposeCtrl = new AbortController();
const sharedSignal = createSignalWrapper(disposeCtrl.signal);
const baseExecutor = (request, excludeQuery) => {
if (sharedSignal.aborted) {
return createResultForAbort(sharedSignal.reason);
if (disposeCtrl.signal.aborted) {
return createResultForAbort(disposeCtrl.signal.reason);
}

@@ -338,3 +321,3 @@ const fetchFn = request.extensions?.fetch ?? options?.fetch ?? fetch;

}
const signals = [sharedSignal];
const signals = [disposeCtrl.signal];
const signalFromRequest = request.signal || request.info?.signal;

@@ -350,3 +333,3 @@ if (signalFromRequest) {

}
const signal = abortSignalAny(signals);
const signal = signals.length > 1 ? abortSignalAny(signals) : signals[0];
const upstreamErrorExtensions = {

@@ -561,4 +544,4 @@ request: {

function retryAttempt() {
if (sharedSignal.aborted) {
return createResultForAbort(sharedSignal.reason);
if (disposeCtrl.signal.aborted) {
return createResultForAbort(disposeCtrl.signal.reason);
}

@@ -565,0 +548,0 @@ attempt++;

{
"name": "@graphql-tools/executor-http",
"version": "1.2.2",
"version": "1.2.3-alpha-eeb5a1d4d585f1315b38da3d023b25283b3ac051",
"type": "module",

@@ -5,0 +5,0 @@ "description": "A set of utils for faster development of GraphQL tools",

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