Skip to content

Avoid changing default DataLoaderRegistry when there are no registrations #915

Closed
@rstoyanchev

Description

@rstoyanchev

We replace the DataLoaderDispatcherInstrumentationState.EMPTY_DATALOADER_REGISTRY instance with a new instance if we have anything to register as the empty one rejects registrations. If the registry remains empty, however, it can lead to side effects like for example graphql-java/graphql-java#3456.

It appears the check is imperfect. As it is we only look check if we have any DataLoaderRegistrars configured, but not whether they are themselves empty or not. Boot declares a BatchLoaderRegistry bean and always passes it in, so there is always at least one registrar, but that may be empty.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions