spring-projects / spring-graphql

Spring Integration for GraphQL
https://spring.io/projects/spring-graphql
Apache License 2.0
1.52k stars 300 forks source link

Support returning `Flux` of entities from `@EntityMapping` methods #991

Closed rstoyanchev closed 3 months ago

rstoyanchev commented 3 months ago

@EntityMapping methods can load entities of a given type in batch mode by returning List<T>, Mono<List<T>>, CompletableFuture<List<T>>, and others. We can also support Flux<T>, and adapt via Flux#collectList.

Based on https://github.com/spring-projects/spring-graphql/issues/922#issuecomment-2142192587 by @gianielsevier.