Open nmartin-RatedPower opened 1 month ago
I see same problem and can only enable introspection by setting these properties both to true
dgs.graphql.introspection.enabled: true spring.graphql.schema.introspectionenabled: true
If both are false the same exception as stated above occurs. Setting one of these properties to true and the other to false does not make introspection working for me.
dgs-version: 9.1.2 spring-boot: 3.3.0
Any update?
I also have this problem, I looked into the configurations:
Setting dgs.graphql.introspection.enabled=false
also automagically sets spring.graphql.schema.introspection.enabled=false
resulting in this error:
The bean 'disableIntrospectionContextContributor', defined in class path resource [com/netflix/graphql/dgs/autoconfig/DgsAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [com/netflix/graphql/dgs/springgraphql/autoconfig/DgsSpringGraphQLAutoConfiguration.class] and overriding is disabled.
When running with debug=true:
DgsAutoConfiguration#disableIntrospectionContextContributor matched:
- @ConditionalOnProperty (dgs.graphql.introspection.enabled=false) matched (OnPropertyCondition)
DgsSpringGraphQLAutoConfiguration#disableIntrospectionContextContributor matched:
- @ConditionalOnProperty (spring.graphql.schema.introspection.enabled=false) matched (OnPropertyCondition)
I only set dgs.graphql.introspection.enabled=false
the spring.graphql.schema.introspection.enabled=false
seems to be automatically set when the former is set.
I guess since DgsSpringGraphQLAutoConfiguration runs before DgsAutoConfiguration
the disableIntrospectionContextContributor
bean defined in DgsAutoConfiguration
should have the annotation @ConditionalOnMissingBean
Setting spring.graphql.schema.introspection.enabled=false
instead of dgs.graphql.introspection.enabled=false
is a workable solution for us.
Please read our contributor guide before creating an issue.
Expected behavior
It is expected that setting the dgs.graphql.introspection.enabled=false property will disable introspection.
Actual behavior
The property dgs.graphql.introspection.enabled=false is set but the application returns the following message.
It works correctly if done through the spring property.
Steps to reproduce
I just added the property in my
.properties
file. Anyways I think could be useful specify the versions wich in working with:DGS version 9.1.1
Springboot version 3.3.0
If you have any doubt don't hesite to ask question about it.
Note: A test case would be highly appreciated, but we understand that's not always possible