Skip to content

MappedBatchLoaders in 6.x? (replacing DataLoaderFactory.newMappedDataLoader from 5.x) #1457

@samuelAndalon

Description

@samuelAndalon

Discussed in #1454

Originally posted by terminalnode June 8, 2022
In our SpringBoot application running 5.x of graphql-kotlin-spring-server (and related libraries) we make heavy use of mapped data loaders using this pattern:

class MyDataLoader() : KotlinDataLoader<K, V> {
  override val dataLoaderName = "MyDataLoader"
  override fun getDataLoader() : DataLoader<K, V> =
    DataLoaderFactory.newMappedDataLoader(/* ... */)
}

In 6.x getDataLoader has been replaced with getBatchLoader which is supposed to return a BatchLoader<K, V>. There is MappedBatchLoader<K, V>, but that's not a BatchLoader.

How would I register mapped batch loaders in 6.x?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions