Skip to content

Commit

Permalink
investigate issue 905
Browse files Browse the repository at this point in the history
  • Loading branch information
yanns committed Jan 15, 2025
1 parent da8bb1e commit cc82732
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ lazy val core = project
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"org.sangria-graphql" %% "sangria-marshalling-testkit" % "1.0.4" % Test,
"org.sangria-graphql" %% "sangria-spray-json" % "1.0.3" % Test,
"org.sangria-graphql" %% "sangria-circe" % "1.3.2" % Test,
"io.circe" %% "circe-parser" % "0.14.2" % Test,
"io.circe" %% "circe-generic" % "0.14.2" % Test,
"org.sangria-graphql" %% "sangria-argonaut" % "1.0.2" % Test,
"org.sangria-graphql" %% "sangria-ion" % "2.0.1" % Test,
"eu.timepit" %% "refined" % "0.11.3" % Test,
Expand Down
36 changes: 36 additions & 0 deletions modules/derivation/src/test/scala/test/issue-905.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import io.circe.Decoder
import sangria.schema.{InputObjectType, ObjectType}

import scala.concurrent.Future

case class Ctx(ctx: String)

object PostSchema {
import sangria.marshalling.circe._
import io.circe.generic.semiauto._
import sangria.macros.derive._

case class UpdatePostGql() {
@GraphQLField
def text(text: TextInputGql): Future[String] = ???
}

object UpdatePostGql {
implicit val _ot: ObjectType[Ctx, UpdatePostGql] =
deriveObjectType[Ctx, UpdatePostGql](
ObjectTypeName("UpdatePost")
)
}

case class TextInputGql(
@GraphQLInputType(sangria.schema.StringType)
text: String)

object TextInputGql {
implicit val decoder: Decoder[TextInputGql] = deriveDecoder[TextInputGql]
implicit val _it: InputObjectType[TextInputGql] =
deriveInputObjectType[TextInputGql](
InputObjectTypeName("TextInput")
)
}
}

0 comments on commit cc82732

Please sign in to comment.