@ file : Suppress (" unused ") Ċ Ċ package Ġgraphql . servlet . og m Ċ Ċ import Ġgraphql . schema . Data Fetching Environment Ċ import Ġgraphql . servlet . GraphQL Context Ċ import Ġkotlinx . coroutines . future . await Ċ import Ġorg . apache . t inker pop . gre mlin . og m . steps . Step Ċ import Ġorg . apache . t inker pop . gre mlin . og m . steps . bound . single . Single Bound Step Ċ import Ġorg . dataloader . DataLoader Ċ Ċ data Ġclass ĠB atched Step Fetcher ( private Ġval Ġenv : ĠData Fetching Environment ) Ġ{ ĊĊĠĠĠ Ġval Ġgraph Mapper Ġget () Ġ= Ġenv . graph Mapper ĊĊĠĠĠ Ġsuspend Ġfun Ġ< FROM , ĠTO > ĠSingle Bound Step . To Optional < FROM , ĠTO >. load (): ĠTO ? Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdata Loader < FROM , ĠTO ? >( step ). load ( from ). await () ĊĊĠĠĠ Ġsuspend Ġfun Ġ< FROM , ĠTO > ĠSingle Bound Step . To Single < FROM , ĠTO >. load (): ĠTO Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdata Loader < FROM , ĠTO >( step ). load ( from ). await () ĊĊĠĠĠ Ġsuspend Ġfun Ġ< FROM , ĠTO > ĠSingle Bound Step . ToMany < FROM , ĠTO >. load (): ĠList < TO > Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdata Loader < FROM , ĠList < TO >>( step ). load ( from ). await () ĊĊĠĠĠ Ġprivate Ġfun Ġ< FROM , ĠTO > Ġdata Loader ( step : ĠStep < *, Ġ* >): ĠDataLoader < FROM , ĠTO > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= Ġenv . getContext < GraphQL Context >() Ġas ? ĠGraph Mapper G QL Context ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠInc orrect GraphQL Context ( env . getContext ()) ĊĠĠĠĠĠĠĠ Ġval Ġdata Loader Registry Ġ= Ġcontext . data Loader Registry . get () ĊĠĠĠĠĠĠĠ Ġval Ġdata Loader Key Ġ= Ġcontext . data Loader Key Lookup [ step ] Ġ?: Ġthrow ĠDataLoader Key NotFound ( step ) ĊĠĠĠĠĠĠĠ Ġreturn Ġdata Loader Registry . getData Loader ( data Loader Key ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġclass ĠDataLoader Key NotFound ( step : ĠStep < *, Ġ* >) Ġ: ĊĠĠĠĠĠĠĠĠĠĠĠ ĠRuntimeException (" Graph Mapper G QL Context . data Loader Key Ġdoes Ġnot Ġhave Ġa Ġkey Ġfor Ġstep Ġ$ step ") Ċ } Ċ