-
Hi! Can i get access to DataFetchingEnvironment from KotlinDataLoader? Or how i can add arguments to subRequests? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
You can always manually create and load data loaders where you can give it info in the See the example app: You can get more info from the data loader docs directly: https://github.com/graphql-java/java-dataloader |
Beta Was this translation helpful? Give feedback.
KotlinDataLoader
is an abstraction on graphql-java DataLoader that the spring server library will autowire for you.You can always manually create and load data loaders where you can give it info in the
DataFetchingEnvironment
. Infact during execution, you have to use theDataFetchingEnvironment
to get data loaders in the first place.See the example app:
graphql-kotlin/examples/server/spring-server/src/main/kotlin/com/expediagroup/graphql/examples/server/spring/query/DataLoaderQuery.kt
Lines 47 to 57 in 2a498e8