-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance(supergraph/runtime): better error messages in case of supergr…
…aph endpoint is down or invalid (#6790) * enhance(supergraph/runtime): better error messages in case of supergraph endpoint is down or invalid * Use default fetch * Check if context has request headers * Fix tests * Better error message * Remove unrelated changes
- Loading branch information
Showing
6 changed files
with
159 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
"@graphql-mesh/supergraph": patch | ||
"@graphql-mesh/runtime": patch | ||
--- | ||
|
||
Better error messages in case of Supergraph SDL endpoint returns invalid result or it is down | ||
|
||
If the endpoint is down; | ||
``` | ||
Failed to generate the schema for the source "supergraph" | ||
Failed to load supergraph SDL from http://down-sdl-source.com/my-sdl.graphql: | ||
Couldn't resolve host name | ||
``` | ||
|
||
If the endpoint returns invalid result; | ||
``` | ||
Failed to generate the schema for the source "supergraph" | ||
Supergraph source must be a valid GraphQL SDL string or a parsed DocumentNode, but got an invalid result from ./fixtures/supergraph-invalid.graphql instead. | ||
Got result: type Query { | ||
Got error: Syntax Error: Expected Name, found <EOF>. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ dist/ | |
/.husky/_/ | ||
.bob/ | ||
.yarn | ||
supergraph-invalid.graphql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/legacy/handlers/supergraph/tests/fixtures/supergraph-invalid.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Query { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters