Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ input CreateSiderealInput {
properMotion: ProperMotionInput
radialVelocity: RadialVelocityInput
parallax: ParallaxModelInput
magnitudes: [MagnitudeInput!]
brightnesses: [MagnitudeInput!]
magnitudes: [MagnitudeInput!] @deprecated(reason: "Use brightnesses instead")
}

# Opaque object cursor
Expand Down
5 changes: 3 additions & 2 deletions gen/output/src/main/scala/test/LucumaODBSchema.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@ object LucumaODB {
implicit val showCreateObservationInput: cats.Show[CreateObservationInput] = cats.Show.fromToString
implicit val jsonEncoderCreateObservationInput: io.circe.Encoder.AsObject[CreateObservationInput] = io.circe.generic.semiauto.deriveEncoder[CreateObservationInput].mapJsonObject(clue.data.Input.dropIgnores)
}
case class CreateSiderealInput(val targetId: clue.data.Input[TargetId] = clue.data.Ignore, val programIds: clue.data.Input[List[ProgramId]] = clue.data.Ignore, val name: NonEmptyString, val catalogId: clue.data.Input[CatalogIdInput] = clue.data.Ignore, val ra: RightAscensionInput, val dec: DeclinationInput, val epoch: clue.data.Input[EpochString] = clue.data.Ignore, val properMotion: clue.data.Input[ProperMotionInput] = clue.data.Ignore, val radialVelocity: clue.data.Input[RadialVelocityInput] = clue.data.Ignore, val parallax: clue.data.Input[ParallaxModelInput] = clue.data.Ignore, val magnitudes: clue.data.Input[List[MagnitudeInput]] = clue.data.Ignore)
case class CreateSiderealInput(val targetId: clue.data.Input[TargetId] = clue.data.Ignore, val programIds: clue.data.Input[List[ProgramId]] = clue.data.Ignore, val name: NonEmptyString, val catalogId: clue.data.Input[CatalogIdInput] = clue.data.Ignore, val ra: RightAscensionInput, val dec: DeclinationInput, val epoch: clue.data.Input[EpochString] = clue.data.Ignore, val properMotion: clue.data.Input[ProperMotionInput] = clue.data.Ignore, val radialVelocity: clue.data.Input[RadialVelocityInput] = clue.data.Ignore, val parallax: clue.data.Input[ParallaxModelInput] = clue.data.Ignore, val brightnesses: clue.data.Input[List[MagnitudeInput]] = clue.data.Ignore, @deprecated("Use brightnesses instead") val magnitudes: clue.data.Input[List[MagnitudeInput]] = clue.data.Ignore)
object CreateSiderealInput {
val targetId: monocle.Lens[CreateSiderealInput, clue.data.Input[TargetId]] = monocle.macros.GenLens[CreateSiderealInput](_.targetId)
val programIds: monocle.Lens[CreateSiderealInput, clue.data.Input[List[ProgramId]]] = monocle.macros.GenLens[CreateSiderealInput](_.programIds)
Expand All @@ -1670,7 +1670,8 @@ object LucumaODB {
val properMotion: monocle.Lens[CreateSiderealInput, clue.data.Input[ProperMotionInput]] = monocle.macros.GenLens[CreateSiderealInput](_.properMotion)
val radialVelocity: monocle.Lens[CreateSiderealInput, clue.data.Input[RadialVelocityInput]] = monocle.macros.GenLens[CreateSiderealInput](_.radialVelocity)
val parallax: monocle.Lens[CreateSiderealInput, clue.data.Input[ParallaxModelInput]] = monocle.macros.GenLens[CreateSiderealInput](_.parallax)
val magnitudes: monocle.Lens[CreateSiderealInput, clue.data.Input[List[MagnitudeInput]]] = monocle.macros.GenLens[CreateSiderealInput](_.magnitudes)
val brightnesses: monocle.Lens[CreateSiderealInput, clue.data.Input[List[MagnitudeInput]]] = monocle.macros.GenLens[CreateSiderealInput](_.brightnesses)
@deprecated("Use brightnesses instead") val magnitudes: monocle.Lens[CreateSiderealInput, clue.data.Input[List[MagnitudeInput]]] = monocle.macros.GenLens[CreateSiderealInput](_.magnitudes)
implicit val eqCreateSiderealInput: cats.Eq[CreateSiderealInput] = cats.Eq.fromUniversalEquals
implicit val showCreateSiderealInput: cats.Show[CreateSiderealInput] = cats.Show.fromToString
implicit val jsonEncoderCreateSiderealInput: io.circe.Encoder.AsObject[CreateSiderealInput] = io.circe.generic.semiauto.deriveEncoder[CreateSiderealInput].mapJsonObject(clue.data.Input.dropIgnores)
Expand Down
2 changes: 1 addition & 1 deletion gen/output/src/main/scala/test/StarWarsQuery.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object StarWarsQuery extends GraphQLOperation[StarWars] {
val id: monocle.Lens[Data.Character.Droid, String] = monocle.macros.GenLens[Data.Character.Droid](_.id)
val name: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.name)
val friends: monocle.Lens[Data.Character.Droid, Option[List[Data.Character.Friends]]] = monocle.macros.GenLens[Data.Character.Droid](_.friends)
val primaryFunction: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.primaryFunction)
@deprecated("Use 'functions' instead") val primaryFunction: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.primaryFunction)
implicit val eqDroid: cats.Eq[Data.Character.Droid] = cats.Eq.fromUniversalEquals
implicit val showDroid: cats.Show[Data.Character.Droid] = cats.Show.fromToString
implicit val jsonDecoderDroid: io.circe.Decoder[Data.Character.Droid] = io.circe.generic.semiauto.deriveDecoder[Data.Character.Droid]
Expand Down
2 changes: 1 addition & 1 deletion gen/output/src/main/scala/test/StarWarsQuery2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ object Wrapper extends Something {
val id: monocle.Lens[Data.Character.Droid, String] = monocle.macros.GenLens[Data.Character.Droid](_.id)
val name: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.name)
val friends: monocle.Lens[Data.Character.Droid, Option[List[Data.Character.Friends]]] = monocle.macros.GenLens[Data.Character.Droid](_.friends)
val primaryFunction: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.primaryFunction)
@deprecated("Use 'functions' instead") val primaryFunction: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.primaryFunction)
implicit val eqDroid: cats.Eq[Data.Character.Droid] = cats.Eq.fromUniversalEquals
implicit val showDroid: cats.Show[Data.Character.Droid] = cats.Show.fromToString
implicit val reuseDroid: japgolly.scalajs.react.Reusability[Data.Character.Droid] = {
Expand Down
2 changes: 1 addition & 1 deletion gen/output/src/main/scala/test/StarWarsQuery3.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object StarWarsQuery3 extends GraphQLOperation[StarWars] {
val id: monocle.Lens[Data.Character.Droid, String] = monocle.macros.GenLens[Data.Character.Droid](_.id)
val name: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.name)
val friends: monocle.Lens[Data.Character.Droid, Option[List[StarWarsSubquery.Data]]] = monocle.macros.GenLens[Data.Character.Droid](_.friends)
val primaryFunction: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.primaryFunction)
@deprecated("Use 'functions' instead") val primaryFunction: monocle.Lens[Data.Character.Droid, Option[String]] = monocle.macros.GenLens[Data.Character.Droid](_.primaryFunction)
implicit val eqDroid: cats.Eq[Data.Character.Droid] = cats.Eq.fromUniversalEquals
implicit val showDroid: cats.Show[Data.Character.Droid] = cats.Show.fromToString
implicit val jsonDecoderDroid: io.circe.Decoder[Data.Character.Droid] = io.circe.generic.semiauto.deriveDecoder[Data.Character.Droid]
Expand Down
7 changes: 4 additions & 3 deletions gen/rules/src/main/scala/clue/gen/Generator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,10 @@ trait Generator {

val addLenses = Option.when(monocleLenses) { (moduleBody: List[Stat]) =>
val lensesDef = params.map { param =>
val thisType = qualifiedNestedType(nestPath, Type.Name(camelName))
val childType = param.typeTree(nextPath, nextTypes)
q"val ${Pat.Var(Term.Name(param.name))}: monocle.Lens[$thisType, $childType] = monocle.macros.GenLens[$thisType](_.${Term
val thisType: Type = qualifiedNestedType(nestPath, Type.Name(camelName))
val childType: Type = param.typeTree(nextPath, nextTypes)
val mod: Option[Mod] = param.deprecation.map(d => mod"@deprecated(${d.reason})")
q"..$mod val ${Pat.Var(Term.Name(param.name))}: monocle.Lens[$thisType, $childType] = monocle.macros.GenLens[$thisType](_.${Term
.Name(param.name)})"
// q"val ${Term.Name(param.name)}: monocle.Lens[$thisType, $childType] = monocle.macros.GenLens[$thisType](_.${Term.Name(param.name)})"
}
Expand Down
9 changes: 8 additions & 1 deletion gen/rules/src/main/scala/clue/gen/SchemaGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ trait SchemaGen extends Generator {
.collect { case InputObjectType(name, _, fields, _) =>
CaseClass(
name.capitalize,
fields.map(iv => ClassParam.fromGrackleType(iv.name, iv.tpe, isInput = true))
fields.map(iv =>
ClassParam.fromGrackleType(
iv.name,
iv.tpe,
isInput = true,
deprecation = Deprecation.fromDirectives(iv.directives)
)
)
)
}
.map(
Expand Down
2 changes: 1 addition & 1 deletion project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Settings {
val circe = "0.14.15"
val disciplineMUnit = "2.0.0"
val fs2 = "3.12.2"
val grackle = "0.25.0"
val grackle = "0.26.0"
val http4s = "0.23.33"
val http4sDom = "0.2.7"
val http4sJDKClient = "0.10.0"
Expand Down
Loading