Skip to content

Commit 7004565

Browse files
committed
Fix dropping of extensions in ContextDataFetcherDecorator
ContextDataFetcherDecorator was not retaining extensions for DataFetchers returning a DataFetcherResult instance.
1 parent ae40015 commit 7004565

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

spring-graphql/src/main/java/org/springframework/graphql/execution/ContextDataFetcherDecorator.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@ public Object get(DataFetchingEnvironment env) throws Exception {
9292
Object value = snapshot.wrap(() -> this.delegate.get(env)).call();
9393

9494
if (value instanceof DataFetcherResult<?> dataFetcherResult) {
95-
Object adapted = updateValue(dataFetcherResult.getData(), snapshot, graphQlContext);
96-
value = DataFetcherResult.newResult()
97-
.data(adapted)
98-
.errors(dataFetcherResult.getErrors())
99-
.localContext(dataFetcherResult.getLocalContext()).build();
95+
value = dataFetcherResult.map(data -> updateValue(data, snapshot, graphQlContext));
10096
}
10197
else {
10298
value = updateValue(value, snapshot, graphQlContext);

0 commit comments

Comments
 (0)