Polishing
This commit is contained in:
@@ -84,13 +84,12 @@ public class DataFetcherHandlerMethod extends InvocableHandlerMethodSupport {
|
||||
* @param environment the GraphQL {@link DataFetchingEnvironment} to use to
|
||||
* resolve arguments.
|
||||
*
|
||||
* @return the raw value returned by the invoked method, which may also be
|
||||
* wrapped as a {@code Mono} in case of method arguments that require
|
||||
* asynchronous resolution, e.g. {@code Principal} in WebFlux; this method
|
||||
* may also return a {@code Mono<Throwable>} if the invocation fails.
|
||||
* @return the raw value returned by the invoked method, possibly a
|
||||
* {@code Mono} in case a method argument requires asynchronous resolution;
|
||||
* {@code Mono<Throwable} is returned if invocation fails.
|
||||
*/
|
||||
@Nullable
|
||||
public Object invoke(DataFetchingEnvironment environment) throws Exception {
|
||||
public Object invoke(DataFetchingEnvironment environment) {
|
||||
Object[] args;
|
||||
try {
|
||||
args = getMethodArgumentValues(environment);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.springframework.graphql;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -136,7 +137,7 @@ public class GraphQlResponse {
|
||||
}
|
||||
|
||||
public static GraphQlResponse from(Mono<? extends ExecutionResult> resultMono) {
|
||||
ExecutionResult result = resultMono.block();
|
||||
ExecutionResult result = resultMono.block(Duration.ofSeconds(5));
|
||||
assertThat(result).isNotNull();
|
||||
return from(result);
|
||||
}
|
||||
@@ -149,7 +150,7 @@ public class GraphQlResponse {
|
||||
|
||||
@SuppressWarnings("BlockingMethodInNonBlockingContext")
|
||||
public static Flux<GraphQlResponse> forSubscription(Mono<ExecutionResult> resultMono) {
|
||||
ExecutionResult result = resultMono.block();
|
||||
ExecutionResult result = resultMono.block(Duration.ofSeconds(5));
|
||||
assertThat(result).isNotNull();
|
||||
return forSubscription(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user