Skip to content

question/maybe feature: support for functional controller definitions #1148

@xenoterracide

Description

@xenoterracide

Does spring graphql support this feature?

https://docs.spring.io/spring-framework/reference/web/webmvc-functional.html
https://docs.spring.io/spring-framework/reference/web/webflux-functional.html

google AI gave me this example (so if it doesn't work...)

@Configuration
public class RouterConfig {

    @Bean
    public RouterFunction<ServerResponse> userRoutes() {
        return route(GET("/hello"), 
                request -> ServerResponse.ok().body("Hello, Lambda!"))
            .and(route(GET("/greet/{name}"), 
                request -> {
                    String name = request.pathVariable("name");
                    return ServerResponse.ok().body("Greetings, " + name + "!");
                })
            );
    }
}

and my thought is it might be a reasonably good solution to #1144

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions