@graphql-tools/executor-http 3.0.6-rc-4edfa719675b4142f39d4fe813824c68d31efbc7 → 3.0.6-rc-fb17a16c3998a79cbe8b00605f0919ea14cf549f

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,6 +1,6 @@
1
1
  # @graphql-tools/executor-http
2
2
 
3
- ## 3.0.6-rc-4edfa719675b4142f39d4fe813824c68d31efbc7
3
+ ## 3.0.6-rc-fb17a16c3998a79cbe8b00605f0919ea14cf549f
4
4
  ### Patch Changes
5
5
 
6
6
 
@@ -9,8 +9,15 @@
9
9
 
10
10
  - Updated dependency [`@graphql-tools/utils@^10.10.1` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.10.1) (from `^10.10.0`, in `dependencies`)
11
11
  - Updated dependency [`@whatwg-node/fetch@^0.10.12` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.10.12) (from `^0.10.11`, in `dependencies`)
12
+
13
+
14
+ - [`c754a96`](https://github.com/graphql-hive/gateway/commit/c754a96d49ea69f54f57a8f1b01baf9d2fb947b6) Thanks [@ardatan](https://github.com/ardatan)! - Use more specific error codes;
15
+
16
+ `GATEWAY_TIMEOUT` -> Server could not get a response from upstream in time
17
+ `SUBREQUEST_HTTP_ERROR` -> An error occurred while making the HTTP request to the upstream
18
+ `RESPONSE_VALIDATION_FAILED` -> The response from upstream did not conform to the expected GraphQL response format
12
19
  - Updated dependencies [[`27789de`](https://github.com/graphql-hive/gateway/commit/27789de7967cb5299d471c00434591f309b978ff)]:
13
- - @graphql-tools/executor-common@1.0.4-rc-4edfa719675b4142f39d4fe813824c68d31efbc7
20
+ - @graphql-tools/executor-common@1.0.4-rc-fb17a16c3998a79cbe8b00605f0919ea14cf549f
14
21
 
15
22
  ## 3.0.5
16
23
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -649,6 +649,7 @@ function buildHTTPExecutor(options) {
649
649
  };
650
650
  }
651
651
  function handleError(e) {
652
+ upstreamErrorExtensions.code = "SUBREQUEST_HTTP_ERROR";
652
653
  if (e.name === "AggregateError") {
653
654
  return {
654
655
  errors: e.errors.map(
@@ -729,6 +730,7 @@ function buildHTTPExecutor(options) {
729
730
  upstreamErrorExtensions.response.body = parsedResult;
730
731
  if (parsedResult.data == null && (parsedResult.errors == null || parsedResult.errors.length === 0)) {
731
732
  const message = `Unexpected empty "data" and "errors" fields in result: ${result}`;
733
+ upstreamErrorExtensions.code = "RESPONSE_VALIDATION_FAILED";
732
734
  return {
733
735
  errors: [
734
736
  utils.createGraphQLError(message, {
@@ -751,6 +753,7 @@ function buildHTTPExecutor(options) {
751
753
  }
752
754
  return parsedResult;
753
755
  } catch (e) {
756
+ upstreamErrorExtensions.code = "RESPONSE_VALIDATION_FAILED";
754
757
  return {
755
758
  errors: [
756
759
  utils.createGraphQLError(
@@ -765,6 +768,7 @@ function buildHTTPExecutor(options) {
765
768
  }
766
769
  } else {
767
770
  const message = "No response returned";
771
+ upstreamErrorExtensions.code = "RESPONSE_VALIDATION_FAILED";
768
772
  return {
769
773
  errors: [
770
774
  utils.createGraphQLError(message, {
package/dist/index.js CHANGED
@@ -647,6 +647,7 @@ function buildHTTPExecutor(options) {
647
647
  };
648
648
  }
649
649
  function handleError(e) {
650
+ upstreamErrorExtensions.code = "SUBREQUEST_HTTP_ERROR";
650
651
  if (e.name === "AggregateError") {
651
652
  return {
652
653
  errors: e.errors.map(
@@ -727,6 +728,7 @@ function buildHTTPExecutor(options) {
727
728
  upstreamErrorExtensions.response.body = parsedResult;
728
729
  if (parsedResult.data == null && (parsedResult.errors == null || parsedResult.errors.length === 0)) {
729
730
  const message = `Unexpected empty "data" and "errors" fields in result: ${result}`;
731
+ upstreamErrorExtensions.code = "RESPONSE_VALIDATION_FAILED";
730
732
  return {
731
733
  errors: [
732
734
  createGraphQLError(message, {
@@ -749,6 +751,7 @@ function buildHTTPExecutor(options) {
749
751
  }
750
752
  return parsedResult;
751
753
  } catch (e) {
754
+ upstreamErrorExtensions.code = "RESPONSE_VALIDATION_FAILED";
752
755
  return {
753
756
  errors: [
754
757
  createGraphQLError(
@@ -763,6 +766,7 @@ function buildHTTPExecutor(options) {
763
766
  }
764
767
  } else {
765
768
  const message = "No response returned";
769
+ upstreamErrorExtensions.code = "RESPONSE_VALIDATION_FAILED";
766
770
  return {
767
771
  errors: [
768
772
  createGraphQLError(message, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/executor-http",
3
- "version": "3.0.6-rc-4edfa719675b4142f39d4fe813824c68d31efbc7",
3
+ "version": "3.0.6-rc-fb17a16c3998a79cbe8b00605f0919ea14cf549f",
4
4
  "type": "module",
5
5
  "description": "A set of utils for faster development of GraphQL tools",
6
6
  "repository": {
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@graphql-hive/signal": "^2.0.0",
43
- "@graphql-tools/executor-common": "1.0.4-rc-4edfa719675b4142f39d4fe813824c68d31efbc7",
43
+ "@graphql-tools/executor-common": "1.0.4-rc-fb17a16c3998a79cbe8b00605f0919ea14cf549f",
44
44
  "@graphql-tools/utils": "^10.10.1",
45
45
  "@repeaterjs/repeater": "^3.0.4",
46
46
  "@whatwg-node/disposablestack": "^0.0.6",