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.