Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 3 different schema derivation nested enum items missing #1993

Closed
guymers opened this issue Nov 8, 2023 · 0 comments · Fixed by #1994
Closed

Scala 3 different schema derivation nested enum items missing #1993

guymers opened this issue Nov 8, 2023 · 0 comments · Fixed by #1994
Assignees
Labels
bug Something isn't working server Issue related to caliban server

Comments

@guymers
Copy link
Contributor

guymers commented Nov 8, 2023

Given the following:

sealed trait Enum1
object Enum1 {
  implicit val schema: Schema[Any, Enum1] = Schema.gen

  sealed trait Enum11 extends Enum1
  object Enum11 {
    implicit val schema: Schema[Any, Enum11] = Schema.gen

    case object Item111 extends Enum11 {
      implicit val schema: Schema[Any, Item111.type] = Schema.gen
    }

    case object Item112 extends Enum11 {
      implicit val schema: Schema[Any, Item112.type] = Schema.gen
    }
  }

  sealed trait Enum12 extends Enum1
  object Enum12 {
    implicit val schema: Schema[Any, Enum12] = Schema.gen

    case object Item121 extends Enum12 {
      implicit val schema: Schema[Any, Item121.type] = Schema.gen
    }
  }
}

Scala 2:

schema {
  query: Queries
}

enum Enum1 {
  Item111
  Item112
  Item121
}

type Queries {
  e: Enum1!
}

Scala 3:

schema {
  query: Queries
}

enum Enum1 {
  Enum11
  Enum12
}

type Queries {
  e: Enum1!
}
@kyri-petrou kyri-petrou self-assigned this Nov 9, 2023
@ghostdogpr ghostdogpr added bug Something isn't working server Issue related to caliban server core labels Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server Issue related to caliban server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants