Skip to content

Spring WebFlux: How to autowire a service/component in a CustomDirective behavior? #1910

@therealansh

Description

@therealansh

I want to autowire a service in a custom directive behaviour. For now I have made a new object only and passed it to the custom wiring. A code snippet here:

 @Bean
    fun wiringFactory() = KotlinDirectiveWiringFactory(
        manualWiring = mapOf<String, KotlinSchemaDirectiveWiring>(
            "hasRole" to CustomDirectiveWiring(
                SomeService(APIService(apiBean()))
            )
        )
    )

Now this becomes a problem when there are multiple services which need to be autowired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions