Skip to content

Commit

Permalink
Add new CharacterInput without Role union
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrico committed Feb 28, 2020
1 parent 75c3ea4 commit d7e68bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion core/src/test/scala/caliban/RenderingSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ object RenderingSpec
| name: String! @external
| nicknames: [String!]! @required
| origin: Origin!
| role: Role
|}
|
|type Captain {
Expand Down
11 changes: 9 additions & 2 deletions core/src/test/scala/caliban/TestUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import caliban.TestUtils.Origin._
import caliban.TestUtils.Role._
import caliban.Value.StringValue
import caliban.parsing.adt.Directive
import caliban.schema.Annotations.{ GQLDeprecated, GQLDescription, GQLDirective, GQLInterface }
import caliban.schema.Annotations.{ GQLDeprecated, GQLDescription, GQLDirective, GQLInputName, GQLInterface }
import caliban.schema.Schema
import zio.UIO
import zio.stream.ZStream
Expand Down Expand Up @@ -44,6 +44,13 @@ object TestUtils {
role: Option[Role]
)

@GQLInputName("CharacterInput")
case class CharacterInput(
@GQLDirective(Directive("external")) name: String,
@GQLDirective(Directive("required")) nicknames: List[String],
origin: Origin
)

object Character {
implicit val schema: Schema[Any, Character] = Schema.gen[Character]
}
Expand All @@ -61,7 +68,7 @@ object TestUtils {
case class CharactersArgs(origin: Option[Origin])
case class CharacterArgs(name: String)
case class CharacterInArgs(@GQLDirective(Directive("lowercase")) names: List[String])
case class CharacterObjectArgs(character: Character)
case class CharacterObjectArgs(character: CharacterInput)

@GQLDescription("Queries")
case class Query(
Expand Down

0 comments on commit d7e68bb

Please sign in to comment.