Provide access to juniper::GraphQLBatchRequest from juniper_rocket::GraphQLRequest via AsRef/AsMut (#968, #930)
This commit is contained in:
parent
5fbd751de2
commit
64fb83f5aa
2 changed files with 13 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
# master
|
# master
|
||||||
|
|
||||||
- Compatibility with the latest `juniper`.
|
- Compatibility with the latest `juniper`.
|
||||||
|
- Provide `AsRef` and `AsMut` implementation for `GraphQLRequest` to its inner type ([#968](https://github.com/graphql-rust/juniper/pull/968), [#930](https://github.com/graphql-rust/juniper/issues/930)).
|
||||||
|
|
||||||
# [[0.8.0] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.8.0)
|
# [[0.8.0] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.8.0)
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,18 @@ pub struct GraphQLRequest<S = DefaultScalarValue>(GraphQLBatchRequest<S>)
|
||||||
where
|
where
|
||||||
S: ScalarValue;
|
S: ScalarValue;
|
||||||
|
|
||||||
|
impl<S: ScalarValue> AsRef<GraphQLBatchRequest<S>> for GraphQLRequest<S> {
|
||||||
|
fn as_ref(&self) -> &GraphQLBatchRequest<S> {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<S: ScalarValue> AsMut<GraphQLBatchRequest<S>> for GraphQLRequest<S> {
|
||||||
|
fn as_mut(&mut self) -> &mut GraphQLBatchRequest<S> {
|
||||||
|
&mut self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Simple wrapper around the result of executing a GraphQL query
|
/// Simple wrapper around the result of executing a GraphQL query
|
||||||
pub struct GraphQLResponse(pub Status, pub String);
|
pub struct GraphQLResponse(pub Status, pub String);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue