-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix returning thrown errors from QP (#457)
The Rust side is expecting a single string in `exception.stacktrace`, but JS was providing an array of strings. It doesn't really make sense to split `error.toString()` as normally the first line will be the error message, and only the later lines will be part of the stack trace, so I think it's best if we use a single string. Ref: https://github.com/apollographql/federation-rs/blob/35052d8064e7ca50d09226febdbbe0d55cc5d18b/federation-2/router-bridge/src/planner.rs#L121-L136 Fixes apollographql/router#4783
- Loading branch information
1 parent
47e99a2
commit b0fa276
Showing
3 changed files
with
102 additions
and
2 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
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
15 changes: 15 additions & 0 deletions
15
...ge/src/snapshots/router_bridge__planner__error_display__propagate_internal_qp_errors.snap
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,15 @@ | ||
--- | ||
source: router-bridge/src/planner.rs | ||
expression: "serde_json::to_string_pretty(&planner.plan(\"subscription { computer(id: 1) { ... @defer { gpus { wattage } } } }\".to_string(),\n None,\n PlanOptions::default()).await.unwrap().errors.unwrap()).unwrap()" | ||
--- | ||
[ | ||
{ | ||
"message": "@defer is not supported on subscriptions", | ||
"extensions": { | ||
"code": "QUERY_PLANNING_FAILED", | ||
"exception": { | ||
"stacktrace": "Error: @defer is not supported on subscriptions" | ||
} | ||
} | ||
} | ||
] |