Skip to content

@BatchMapping triggers the registration of a data fetcher imperatively in the global data loader registry #1471

@hibnico

Description

@hibnico

In the default Spring Boot configuration, there can be only one GraphQL endpoint. To have more than one, Spring GraphQL beans needs to be redefined, duplicated as needed. So far so good, especially since the lastest addition of controllerPredicate on the AnnotatedControllerDetectionSupport via #1275.

I am still hitting an issue with a such configuration though. @BatchMapping annotations trigger the registeration of data fetchers. But the registry being used to register them is fetched from the application context. In my project, I have many, and I don't even put them in the application context.

The issue seems to be in AnnotatedControllerConfigurer#registerBatchLoader

Could the BatchLoaderRegistry be injected in the AnnotatedControllerConfigurer rather than fetched from the application context ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions