From 5aacc8dcf024d317f611ae9b896266705e6d2fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20W=C3=A4rnsberg?= Date: Tue, 23 Nov 2021 21:20:06 +0100 Subject: [PATCH] fix: Make sure we use the directive for handrolled fields --- core/src/main/scala/caliban/schema/Schema.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/caliban/schema/Schema.scala b/core/src/main/scala/caliban/schema/Schema.scala index 41c99a7f3..1c84c3b1e 100644 --- a/core/src/main/scala/caliban/schema/Schema.scala +++ b/core/src/main/scala/caliban/schema/Schema.scala @@ -635,7 +635,13 @@ case class PartiallyAppliedFieldLazy[V](name: String, description: Option[String case class PartiallyAppliedFieldWithArgs[V, A](name: String, description: Option[String], directives: List[Directive]) { def apply[R, V1](fn: V => (A => V1))(implicit ev1: Schema[R, A => V1], fa: FieldAttributes): (__Field, V => Step[R]) = ( - __Field(name, description, ev1.arguments, () => ev1.toType_(fa.isInput, fa.isSubscription)), + __Field( + name, + description, + ev1.arguments, + () => ev1.toType_(fa.isInput, fa.isSubscription), + directives = Some(directives).filter(_.nonEmpty) + ), (v: V) => ev1.resolve(fn(v)) ) }