mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-13 19:33:55 +03:00
update interface of GraphQLResponse for multitenant (#760)
<!-- The PR description should answer 2 (maybe 3) important questions: --> ### What Update the interface of `GraphQLResponse` - make some functions public - added some helper functions that are used in v3-engine-multitenant <!-- What is this PR trying to accomplish (and why, if it's not obvious)? --> <!-- Consider: do we need to add a changelog entry? --> ### How <!-- How is it trying to accomplish it (what are the implementation steps)? --> V3_GIT_ORIGIN_REV_ID: 691ff8e3505f96ba9e9a2e8518023e4812319a05
This commit is contained in:
parent
e15cd1ce39
commit
91ec7bafd1
@ -65,17 +65,25 @@ impl<'a> TraceableError for GraphQLErrors<'a> {
|
|||||||
pub struct GraphQLResponse(gql::http::Response);
|
pub struct GraphQLResponse(gql::http::Response);
|
||||||
|
|
||||||
impl GraphQLResponse {
|
impl GraphQLResponse {
|
||||||
fn from_result(result: ExecuteQueryResult) -> Self {
|
pub fn from_result(result: ExecuteQueryResult) -> Self {
|
||||||
Self(result.to_graphql_response())
|
Self(result.to_graphql_response())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_error(err: &error::RequestError) -> Self {
|
pub fn from_error(err: &error::RequestError) -> Self {
|
||||||
Self(Response::error(
|
Self(Response::error(
|
||||||
err.to_graphql_error(),
|
err.to_graphql_error(),
|
||||||
axum::http::HeaderMap::default(),
|
axum::http::HeaderMap::default(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn from_response(response: gql::http::Response) -> Self {
|
||||||
|
Self(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn does_contain_error(&self) -> bool {
|
||||||
|
self.0.does_contains_error()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn inner(self) -> gql::http::Response {
|
pub fn inner(self) -> gql::http::Response {
|
||||||
self.0
|
self.0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user