Suppose I have below query method defined, Lets say getAllBooks returns 10 books, now if we query for price too, price method will be called multiple times (10 times in this case). How can I batch the call to price method.
@GraphQLQuery(name = "getAllBooks", description = "Get all books")
public List<Book> getAllBooks() {
return bookService.getAllBooks();
}
@GraphQLQuery
public Long price(@GraphQLContext Book book) {
return 10L; //In real world problem I want to fetch price from another internal http service.
}
I am looking for solution something similar to posted in below post.
https://jskim1991.medium.com/spring-boot-batching-graphql-queries-with-batchmapping-ed5955835432
Not sure what exactly I need to use in graphql-spqr
New contributor