Description
It appears in the SchemaParser#createInputObject
that the default value of input fields is not set to a proper value if it is an enum.
When the default value of a field on an input type is an enum, the parser is supplying an EnumValue
, and it is being set, so when the schema metadata is retrieved, a CoercingSerializeException
is thrown by graphql-java, since it can't do any comparison of `EnumValue.
However, further down the SchemaParser
, the createField
method uses the buildDefaultValue
function for the default value. By simply changing createInputObject
to use buildDefaultValue
, this seems to fix it.
The issue tracks down to the GraphQLEnumType
:
The value being passed in ends up looking like EnumValue{name='FOO'}
, which will never match, but by using buildDefaultValue
, it turns it into the enum name, which the check will succeed.
All of this is may be moot point however, since it appears that graphql-java
doesn't seem to support default values inside of input types (it gets coerced into a null value if is not present). However, I believe this is definitely a bug on the graphql-java-tools side.
What I'm not sure of is the possible complications of always using buildDefaultValue(inputDefinition.defaultValue)
, if any.