When the input type is a ["a"] and the graphql schema describes it as a input-object, it throws
java.lang.ClassCastException
Stack trace of root exception is empty; this is likely due to a JVM optimization that can be disabled with -XX:-OmitStackTraceInFastThrow.
java.lang.ClassCastException:
After add -XX:-OmitStackTraceInFastThrow, we can find a less-worst message:
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map$Entry (java.lang.String and java.util.Map$Entry are in module java.base of loader 'bootstrap')
But I think that it could be improved. For both the developer and the API consumer.
The root cause is this line: it assumes that the object is a {} and tries to reduce over its keys.
When the input type is a
["a"]
and the graphql schema describes it as ainput-object
, it throwsAfter add
-XX:-OmitStackTraceInFastThrow
, we can find a less-worst message:But I think that it could be improved. For both the developer and the API consumer.
The root cause is this line: it assumes that the object is a
{}
and tries to reduce over its keys.https://github.com/walmartlabs/lacinia/blob/master/src/com/walmartlabs/lacinia/parser.clj#L541
Here a test that reproduce the error