-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Description
My dataFetcher have some business logic, so need async.
How to use dataloader return some base data.
eg:
BuildWiring is :
RuntimeWiring.newRuntimeWiring()
.type(newTypeWiring("Query")
.dataFetcher("bookById", AsyncDataFetcher.async(graphQLDataFetchers.getBookByIdDataFetcher(), pool)))
.type(newTypeWiring("Book")
.dataFetcher("author", async(graphQLDataFetchers.getAuthorDataFetcher(), pool)))
.build();
Fetcher.java is:
...
DataLoader<Object, Object> characters = dataFetchingEnvironment.getDataLoader("books");
CompletableFuture<Object> book = characters.load(bookId);
return book;
The root cause is the result
is CompletableFuture<CompletableFuture < Object > >, but graphql only parsing a .get()
method;
Metadata
Metadata
Assignees
Labels
No labels