-
Notifications
You must be signed in to change notification settings - Fork 323
Closed as not planned
Labels
in: coreIssues related to config and core supportIssues related to config and core supportstatus: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Version: Spring GraphQL 1.3.1
Let's suppose you have defined a type called TestObject:
type TestObject {
id: ID!
name: String
}
And for some reason, you mistyped the name
property or forgot to define a getter method for name
, which is private. The Spring GraphQL Framework will generate the following error if property spring.graphql.schema.inspection.enabled: true
:
Caused by: java.lang.IllegalArgumentException: Method must not be null
at org.springframework.util.Assert.notNull(Assert.java:172)
at org.springframework.core.ResolvableType.forMethodReturnType(ResolvableType.java:1272)
at org.springframework.graphql.execution.SchemaMappingInspector.checkFieldsContainer(SchemaMappingInspector.java:173)
at org.springframework.graphql.execution.SchemaMappingInspector.checkField(SchemaMappingInspector.java:235)
And this error does not show much about the problem. It would be nice if we instead of calling:
line: 173 > checkField(fieldContainer, field, ResolvableType.forMethodReturnType(descriptor.getReadMethod()));
We could call a function that translates this IllegalArgumentException into a more friendly error message, like: "Type: TestObject, property: name does not have a reader method defined!"
Thanks guys.
Metadata
Metadata
Assignees
Labels
in: coreIssues related to config and core supportIssues related to config and core supportstatus: invalidAn issue that we don't feel is validAn issue that we don't feel is valid