@graphql-tools/executor-http 1.3.2 → 2.0.0-alpha-9d485cf5212d1d311863e5dd41e373865e18ba0b

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,21 @@
1
1
  # @graphql-tools/executor-http
2
2
 
3
+ ## 2.0.0-alpha-9d485cf5212d1d311863e5dd41e373865e18ba0b
4
+
5
+ ### Major Changes
6
+
7
+ - [#997](https://github.com/graphql-hive/gateway/pull/997) [`9d485cf`](https://github.com/graphql-hive/gateway/commit/9d485cf5212d1d311863e5dd41e373865e18ba0b) Thanks [@ardatan](https://github.com/ardatan)! - - **BREAKING**: HTTP Executor no longer takes `serviceName` as an option.
8
+
9
+ - Both HTTP executor and `@graphql-mesh/transport-http-callback` no longer handle `DOWNSTREAM_SERVICE_ERROR` error code with `serviceName`.
10
+ - Gateway runtime handles subgraph errors on its own with `DOWNSTREAM_SERVICE_ERROR` error code and `serviceName` as a property. This behavior can be configured with `subgraphErrors` option of the `createGatewayRuntime` function or CLI config.
11
+
12
+ ```ts
13
+ subgraphError: {
14
+ errorCode: 'DOWNSTREAM_SERVICE_ERROR', // or `false` to remove this code completely
15
+ subgraphNameProp: 'serviceName' // or `false` to remove this prop completely
16
+ }
17
+ ```
18
+
3
19
  ## 1.3.2
4
20
 
5
21
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -520,7 +520,6 @@ function prepareGETUrl({
520
520
  function buildHTTPExecutor(options) {
521
521
  const printFn = options?.print ?? executorCommon.defaultPrintFn;
522
522
  const disposeCtrl = new AbortController();
523
- const serviceName = options?.serviceName;
524
523
  const baseExecutor = (request, excludeQuery) => {
525
524
  if (disposeCtrl.signal.aborted) {
526
525
  return createResultForAbort(disposeCtrl.signal.reason);
@@ -570,8 +569,6 @@ function buildHTTPExecutor(options) {
570
569
  }
571
570
  const signal$1 = signal.abortSignalAny(signals);
572
571
  const upstreamErrorExtensions = {
573
- code: "DOWNSTREAM_SERVICE_ERROR",
574
- serviceName,
575
572
  request: {
576
573
  method
577
574
  }
@@ -745,14 +742,7 @@ function buildHTTPExecutor(options) {
745
742
  ({
746
743
  message,
747
744
  ...options2
748
- }) => utils.createGraphQLError(message, {
749
- ...options2,
750
- extensions: {
751
- code: "DOWNSTREAM_SERVICE_ERROR",
752
- serviceName,
753
- ...options2.extensions || {}
754
- }
755
- })
745
+ }) => utils.createGraphQLError(message, options2)
756
746
  )
757
747
  };
758
748
  }
package/dist/index.d.cts CHANGED
@@ -14,10 +14,6 @@ type FetchFn = AsyncFetchFn | SyncFetchFn | RegularFetchFn;
14
14
  type AsyncImportFn = (moduleName: string) => PromiseLike<any>;
15
15
  type SyncImportFn = (moduleName: string) => any;
16
16
  interface HTTPExecutorOptions {
17
- /**
18
- * The name of the service
19
- */
20
- serviceName?: string;
21
17
  /**
22
18
  * The endpoint to use when querying the upstream API
23
19
  * @default '/graphql'
package/dist/index.d.ts CHANGED
@@ -14,10 +14,6 @@ type FetchFn = AsyncFetchFn | SyncFetchFn | RegularFetchFn;
14
14
  type AsyncImportFn = (moduleName: string) => PromiseLike<any>;
15
15
  type SyncImportFn = (moduleName: string) => any;
16
16
  interface HTTPExecutorOptions {
17
- /**
18
- * The name of the service
19
- */
20
- serviceName?: string;
21
17
  /**
22
18
  * The endpoint to use when querying the upstream API
23
19
  * @default '/graphql'
package/dist/index.js CHANGED
@@ -518,7 +518,6 @@ function prepareGETUrl({
518
518
  function buildHTTPExecutor(options) {
519
519
  const printFn = options?.print ?? defaultPrintFn;
520
520
  const disposeCtrl = new AbortController();
521
- const serviceName = options?.serviceName;
522
521
  const baseExecutor = (request, excludeQuery) => {
523
522
  if (disposeCtrl.signal.aborted) {
524
523
  return createResultForAbort(disposeCtrl.signal.reason);
@@ -568,8 +567,6 @@ function buildHTTPExecutor(options) {
568
567
  }
569
568
  const signal = abortSignalAny(signals);
570
569
  const upstreamErrorExtensions = {
571
- code: "DOWNSTREAM_SERVICE_ERROR",
572
- serviceName,
573
570
  request: {
574
571
  method
575
572
  }
@@ -743,14 +740,7 @@ function buildHTTPExecutor(options) {
743
740
  ({
744
741
  message,
745
742
  ...options2
746
- }) => createGraphQLError(message, {
747
- ...options2,
748
- extensions: {
749
- code: "DOWNSTREAM_SERVICE_ERROR",
750
- serviceName,
751
- ...options2.extensions || {}
752
- }
753
- })
743
+ }) => createGraphQLError(message, options2)
754
744
  )
755
745
  };
756
746
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/executor-http",
3
- "version": "1.3.2",
3
+ "version": "2.0.0-alpha-9d485cf5212d1d311863e5dd41e373865e18ba0b",
4
4
  "type": "module",
5
5
  "description": "A set of utils for faster development of GraphQL tools",
6
6
  "repository": {
@@ -56,7 +56,7 @@
56
56
  "extract-files": "13.0.0",
57
57
  "graphql": "^16.9.0",
58
58
  "graphql-yoga": "^5.13.2",
59
- "pkgroll": "2.11.2"
59
+ "pkgroll": "2.12.1"
60
60
  },
61
61
  "sideEffects": false
62
62
  }