Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: DgsSpringGraphQLAutoConfiguration not compatible with WebFluxHateoasConfiguration #1946

Closed
mformanek-ata opened this issue Jun 26, 2024 · 1 comment

Comments

@mformanek-ata
Copy link

Hi, we have an application that has spring hateoas as a dependency and are in process of migration from old starter DGS starter to new one. Their configuration inside org.springframework.hateoas.config.WebFluxHateoasConfiguration contains following bean

@Bean
@Lazy
ServerWebExchangeContextFilter serverWebExchangeContextFilter() {
	return new ServerWebExchangeContextFilter();
}

which is also defined by DGS:

Expected behavior

App starts as expected

Actual behavior

App crashes on BeanDefinitionOverrideException

Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'serverWebExchangeContextFilter' defined in class path resource [org/springframework/hateoas/config/WebFluxHateoasConfiguration.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=true; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.hateoas.config.WebFluxHateoasConfiguration; factoryMethodName=serverWebExchangeContextFilter; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [org/springframework/hateoas/config/WebFluxHateoasConfiguration.class]] for bean 'serverWebExchangeContextFilter' since there is already [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=com.netflix.graphql.dgs.springgraphql.autoconfig.DgsSpringGraphQLAutoConfiguration$ReactiveConfiguration; factoryMethodName=serverWebExchangeContextFilter; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [com/netflix/graphql/dgs/springgraphql/autoconfig/DgsSpringGraphQLAutoConfiguration$ReactiveConfiguration.class]]

Could you please add some condition, so that filter gets created only in case it does not already exist? 🙇‍♂️

@srinivasankavitha
Copy link
Contributor

Thanks for pointing this out. fixed in #1949.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants