Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 00a48b7

Browse files
authored
Merge pull request #471 from tomas-c/bugfix/error-sanitization-with-webflux
Update GraphQLController to use ObjectMapper to map ExecutionResult
2 parents 523a238 + 28e18a6 commit 00a48b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

graphql-kickstart-spring-webflux/src/main/java/graphql/kickstart/spring/webflux/GraphQLController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414

1515
@RestController
1616
public class GraphQLController extends AbstractGraphQLController {
17-
17+
private final GraphQLObjectMapper objectMapper;
1818
private final GraphQLInvoker graphQLInvoker;
1919
private final GraphQLSpringInvocationInputFactory invocationInputFactory;
2020

2121
public GraphQLController(GraphQLObjectMapper objectMapper, GraphQLInvoker graphQLInvoker,
2222
GraphQLSpringInvocationInputFactory invocationInputFactory) {
2323
super(objectMapper);
24+
this.objectMapper = objectMapper;
2425
this.graphQLInvoker = graphQLInvoker;
2526
this.invocationInputFactory = invocationInputFactory;
2627
}
@@ -33,7 +34,7 @@ protected Object executeRequest(
3334
GraphQLSingleInvocationInput invocationInput = invocationInputFactory
3435
.create(new GraphQLRequest(query, variables, operationName), serverWebExchange);
3536
Mono<ExecutionResult> executionResult = Mono.fromCompletionStage(graphQLInvoker.executeAsync(invocationInput));
36-
return executionResult.map(ExecutionResult::toSpecification);
37+
return executionResult.map(objectMapper::createResultFromExecutionResult);
3738
}
3839

3940
}

0 commit comments

Comments
 (0)