File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ All user visible changes to `juniper` crate will be documented in this file. Thi
4343 - ` jiff::tz::TimeZone ` as ` TimeZoneOrUtcOffset ` and ` TimeZone ` scalars.
4444 - ` jiff::tz::Offset ` as ` UtcOffset ` scalar.
4545 - ` jiff::Span ` as ` Duration ` scalar.
46+ - ` http::GraphQLResponse::into_result() ` method. ([ #1293 ] )
4647
4748### Changed
4849
@@ -62,6 +63,7 @@ All user visible changes to `juniper` crate will be documented in this file. Thi
6263[ #1281 ] : /../../pull/1281
6364[ #1284 ] : /../../pull/1284
6465[ #1287 ] : /../../issues/1287
66+ [ #1293 ] : /../../pull/1293
6567[ #1311 ] : /../../pull/1311
6668[ #1316 ] : /../../pull/1316
6769[ #1318 ] : /../../pull/1318
Original file line number Diff line number Diff line change @@ -171,20 +171,28 @@ impl<S> GraphQLResponse<S>
171171where
172172 S : ScalarValue ,
173173{
174- /// Constructs new `GraphQLResponse` using the given result
174+ /// Constructs a new [`GraphQLResponse`] from the provided execution [`Result`].
175+ #[ must_use]
175176 pub fn from_result ( r : Result < ( Value < S > , Vec < ExecutionError < S > > ) , GraphQLError > ) -> Self {
176177 Self ( r)
177178 }
178179
179- /// Constructs an error response outside of the normal execution flow
180+ /// Unwraps this [`GraphQLResponse`] into its underlying execution [`Result`].
181+ pub fn into_result ( self ) -> Result < ( Value < S > , Vec < ExecutionError < S > > ) , GraphQLError > {
182+ self . 0
183+ }
184+
185+ /// Constructs an error [`GraphQLResponse`] outside the normal execution flow.
186+ #[ must_use]
180187 pub fn error ( error : FieldError < S > ) -> Self {
181- GraphQLResponse ( Ok ( ( Value :: null ( ) , vec ! [ ExecutionError :: at_origin( error) ] ) ) )
188+ Self ( Ok ( ( Value :: null ( ) , vec ! [ ExecutionError :: at_origin( error) ] ) ) )
182189 }
183190
184- /// Was the request successful or not?
191+ /// Indicates whether this [`GraphQLResponse`] contains a successful execution [`Result`].
185192 ///
186- /// Note that there still might be errors in the response even though it's
187- /// considered OK. This is by design in GraphQL.
193+ /// **NOTE**: There still might be errors in the response even though it's considered OK.
194+ /// This is by design in GraphQL.
195+ #[ must_use]
188196 pub fn is_ok ( & self ) -> bool {
189197 self . 0 . is_ok ( )
190198 }
You can’t perform that action at this time.
0 commit comments