You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In DGS 10.0.1, we are now running tests with @EnableDgsMockMvcTest.
In these tests, DGS validates our schema using the SchemaMappingInspector from spring-graphql.
This inspector does not allow the same patterns for Java Beans as DGS does. Boolean flags cannot be resolved the following way.
allowed: Boolean!
public Boolean isAllowed() {
return this.isAllowed;
}
When I just start the Application everything works without any Issues. It seems the SchemaMappingInspector is only used in Mvc-Tests?
Expected behavior
A schema that works without issues in DGS should also be correctly validated by spring-graphql within tests. Or there should be an option to disable the SchemaMappingInspector in Tests.
Actual behavior
I get the following Exception when I start the test.
Caused by: java.lang.IllegalArgumentException: Method must not be null
at org.springframework.util.Assert.notNull(Assert.java:172)
at org.springframework.core.MethodParameter.<init>(MethodParameter.java:128)
at org.springframework.core.MethodParameter.<init>(MethodParameter.java:114)
at org.springframework.graphql.execution.SchemaMappingInspector.checkFieldsContainer(SchemaMappingInspector.java:184)
at org.springframework.graphql.execution.SchemaMappingInspector.checkField(SchemaMappingInspector.java:254)
at org.springframework.graphql.execution.SchemaMappingInspector.checkFieldsContainer(SchemaMappingInspector.java:185)
at org.springframework.graphql.execution.SchemaMappingInspector.checkField(SchemaMappingInspector.java:254)
at org.springframework.graphql.execution.SchemaMappingInspector.checkFieldsContainer(SchemaMappingInspector.java:173)
at org.springframework.graphql.execution.SchemaMappingInspector.checkField(SchemaMappingInspector.java:254)
at org.springframework.graphql.execution.SchemaMappingInspector.checkFieldsContainer(SchemaMappingInspector.java:185)
at org.springframework.graphql.execution.SchemaMappingInspector.checkField(SchemaMappingInspector.java:254)
at org.springframework.graphql.execution.SchemaMappingInspector.checkFieldsContainer(SchemaMappingInspector.java:173)
at org.springframework.graphql.execution.SchemaMappingInspector.checkField(SchemaMappingInspector.java:254)
at org.springframework.graphql.execution.SchemaMappingInspector.checkFieldsContainer(SchemaMappingInspector.java:173)
at org.springframework.graphql.execution.SchemaMappingInspector.checkSchemaFields(SchemaMappingInspector.java:139)
at org.springframework.graphql.execution.SchemaMappingInspector.getOrCreateReport(SchemaMappingInspector.java:130)
at org.springframework.graphql.execution.SchemaMappingInspector$DefaultInitializer.inspect(SchemaMappingInspector.java:447)
at org.springframework.graphql.execution.SchemaMappingInspector.inspect(SchemaMappingInspector.java:317)
at com.netflix.graphql.dgs.springgraphql.DgsGraphQLSourceBuilder.setupSchemaReporter$lambda$2(DgsGraphQLSourceBuilder.kt:152)
The text was updated successfully, but these errors were encountered:
With the latest Spring version, the SchemaMappingInspector no longer throws exceptions. However, it still incorrectly classifies the ‘allowed’ field as an unmapped field, even though I can query it using GraphiQL.
Since no exception is thrown anymore, it is not a big problem for us, but it is probably still not ideal that Spring classifies ‘allowed’ as an unmapped field, even I can query it with DGS.
In DGS 10.0.1, we are now running tests with
@EnableDgsMockMvcTest
.In these tests, DGS validates our schema using the
SchemaMappingInspector
from spring-graphql.This inspector does not allow the same patterns for Java Beans as DGS does. Boolean flags cannot be resolved the following way.
allowed: Boolean!
When I just start the Application everything works without any Issues. It seems the
SchemaMappingInspector
is only used in Mvc-Tests?Expected behavior
A schema that works without issues in DGS should also be correctly validated by spring-graphql within tests. Or there should be an option to disable the
SchemaMappingInspector
in Tests.Actual behavior
I get the following Exception when I start the test.
The text was updated successfully, but these errors were encountered: