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
I have a case class which contains an enum for which I use EnumType()and deriveInputObjectType[] to create the schema.
Sangria shows an Argument 'testEnum' has invalid value: CNil when I send something like:
MethodCall(testCaseClass: {
name: "just a name",
testEnum: FIRST
}) {
result
}
If I use testEnum as a parameter of a mutation directly, everything works fine. It seems that this problem only appears when an enum is used as part of a case class.
I am using Sangria 2.0.1, Circe 0.13.0 and Sangria-Circe 1.3.1
The text was updated successfully, but these errors were encountered:
I have the exact same issue. Enum field in a case class input object cause this same error. Really anoying as I have no clue how to fix it except implementing a fromInput for all InputObject that use this enum.
Unfortunately, this issue is still not resolved. Here is a short example of how to recreate the problem:
sealed trait TestEnum
case object TestA extends TestEnum
case object TestB extends TestEnum
case object TestC extends TestEnum
final case class Test(id: String, test: TestEnum)
implicit val TestEnumType = deriveEnumType[TestEnum]()
implicit val TestObjectType: ObjectType[CallContext, Test] = deriveObjectType[CallContext, Test]()
implicit val TestInputType: InputObjectType[Test] = deriveInputObjectType[Test](
InputObjectTypeName("testInput")
)
val TestArg = Argument("test", TestInputType)
Field(
s"setTest", BooleanType,
arguments = TestArg :: Nil,
resolve = ctx => {
println(ctx arg TestArg)
true
}
)
I am now using Sangria 3.0.0-RC7, Sangria-Circe 1.3.2 and Circe 0.14.1
owetterau
changed the title
enum in case class fails with "Argument 'xyz' has invalid value: CNil"
BLOCKING BUG: enum in case class fails with "Argument 'xyz' has invalid value: CNil"
Jan 14, 2022
I have a case class which contains an enum for which I use
EnumType()
andderiveInputObjectType[]
to create the schema.Sangria shows an
Argument 'testEnum' has invalid value: CNil
when I send something like:If I use
testEnum
as a parameter of a mutation directly, everything works fine. It seems that this problem only appears when an enum is used as part of a case class.I am using Sangria 2.0.1, Circe 0.13.0 and Sangria-Circe 1.3.1
The text was updated successfully, but these errors were encountered: