sangria-graphql/sangria

BLOCKING BUG: enum in case class fails with "Argument 'xyz' has invalid value: CNil"

Open

#528 opened on Nov 4, 2020

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Scala (219 forks)batch import
help wanted

Repository metrics

Stars
 (1,961 stars)
PR merge metrics
 (Avg merge 8d 15h) (4 merged PRs in 30d)

Description

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

Contributor guide