Polishing

This commit is contained in:
Rossen Stoyanchev
2021-11-25 10:44:33 +00:00
parent d9e988670e
commit 5f260d12f6
2 changed files with 7 additions and 7 deletions

View File

@@ -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);

View File

@@ -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);
}