@graphql-tools/executor-http 3.1.4 → 3.2.0-alpha-cbec8f1108fe6a7a06eaebd7200c5fb91f50db05

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @graphql-tools/executor-http
2
2
 
3
+ ## 3.2.0-alpha-cbec8f1108fe6a7a06eaebd7200c5fb91f50db05
4
+ ### Minor Changes
5
+
6
+
7
+
8
+ - [#2211](https://github.com/graphql-hive/gateway/pull/2211) [`3e4187b`](https://github.com/graphql-hive/gateway/commit/3e4187b340801fee45df8df891617afcfc8b4b30) Thanks [@ardatan](https://github.com/ardatan)! - Add `onHTTPResponse` hook to get `Response` returned by `fetch`;
9
+
10
+ ```ts
11
+ import { buildHTTPExecutor } from '@graphql-tools/executor-http';
12
+
13
+ const executor = buildHTTPExecutor({
14
+ onHTTPResponse(response) {
15
+ console.log('Received response with status:', response.status);
16
+ },
17
+ });
18
+ ```
19
+
3
20
  ## 3.1.4
4
21
  ### Patch Changes
5
22
 
package/dist/index.cjs CHANGED
@@ -699,6 +699,7 @@ function buildHTTPExecutor(options) {
699
699
  ),
700
700
  (fetchResult) => promiseHelpers.handleMaybePromise(
701
701
  () => {
702
+ options?.onHTTPResponse?.(fetchResult);
702
703
  upstreamErrorExtensions.response ||= {};
703
704
  upstreamErrorExtensions.response.status = fetchResult.status;
704
705
  upstreamErrorExtensions.response.statusText = fetchResult.statusText;
package/dist/index.d.cts CHANGED
@@ -92,6 +92,7 @@ interface HTTPExecutorOptions {
92
92
  * @default true
93
93
  */
94
94
  deduplicateInflightRequests?: boolean;
95
+ onHTTPResponse?(response: Response): void;
95
96
  }
96
97
  type HeadersConfig = Record<string, string>;
97
98
  interface InflightRequestOptions {
package/dist/index.d.ts CHANGED
@@ -92,6 +92,7 @@ interface HTTPExecutorOptions {
92
92
  * @default true
93
93
  */
94
94
  deduplicateInflightRequests?: boolean;
95
+ onHTTPResponse?(response: Response): void;
95
96
  }
96
97
  type HeadersConfig = Record<string, string>;
97
98
  interface InflightRequestOptions {
package/dist/index.js CHANGED
@@ -697,6 +697,7 @@ function buildHTTPExecutor(options) {
697
697
  ),
698
698
  (fetchResult) => handleMaybePromise(
699
699
  () => {
700
+ options?.onHTTPResponse?.(fetchResult);
700
701
  upstreamErrorExtensions.response ||= {};
701
702
  upstreamErrorExtensions.response.status = fetchResult.status;
702
703
  upstreamErrorExtensions.response.statusText = fetchResult.statusText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/executor-http",
3
- "version": "3.1.4",
3
+ "version": "3.2.0-alpha-cbec8f1108fe6a7a06eaebd7200c5fb91f50db05",
4
4
  "type": "module",
5
5
  "description": "A set of utils for faster development of GraphQL tools",
6
6
  "repository": {