Skip to content

A configurable AnnotatedControllerConfigurer for multiple graphql endpoints #1275

@hibnico

Description

@hibnico

The default spring boot configuration expose only one endpoint. To expose multiple endpoints (like a "public" one and an "admin" one), the auto configuration has to be disabled and the configuration has to be written accordingly. There are sample of such setup, like this one https://github.com/codesnippe/multiple-graphql-endpoints-demo. So far so good, this is totally fine with me.

There is still an issue with such a setup: the AnnotatedControllerConfigurer is still global. When defining a @QueryMapping, there is no guarantee that this endpoint will end up serving a particular schema over the other.

So I went to redefine my own AnnotatedControllerConfigurer which is instanciated twice, one for my "public" schema and my annotation @PublicGQLController, and one for my "admin" schema and my annotation @AdminGQLController.

This issue is that is not very practical to redefine a AnnotatedControllerConfigurer just to change the annotation being looked up. Due to the private functions and classes used in this class, a lot of code has to be duplicated.

Thus, is would be nice if the class AnnotatedControllerConfigurer could allow the configuration of a custom annotation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions