https://kotlinlang.org logo
#graphql-kotlin
Title
# graphql-kotlin
m

Martin Brehovsky

06/16/2021, 12:57 AM
I’m trying to figure out how to “connect” my
KotlinDataLoader
and my custom context derived from
SpringGraphQLContext
. Is there any way to use the custom context from the dataloader itself?
*context is accessible from data fetching env
m

Martin Brehovsky

06/16/2021, 3:55 PM
Thanks. Just to make sure I understand the discussion well - in the case I need
DataFetchingEnvironment
, I cannot use
KotlinDataLoader
, but I have to build a
DataFetcher
and then deal with the registration myself?
d

Dariusz Kuc

06/16/2021, 4:18 PM
kotlin data loader is an abstraction over basic data loader
What Shane was saying is that you can access the data fetching env/context from a method that invokes the data loader edit: discussion was showing an example with custom data fetcher for late init field
m

Martin Brehovsky

06/16/2021, 4:22 PM
Thanks, I need to wrap my head around it a bit more. Will likely ask more questions 🙂
d

Dariusz Kuc

06/16/2021, 4:28 PM
ah actually the response there is to use custom data fetcher (that invokes the data loader) for the late init field
3 Views