diff --git a/examples/src/main/resources/gateway_v2/package.json b/examples/src/main/resources/gateway_v2/package.json index df5a301aa2..2920c27889 100644 --- a/examples/src/main/resources/gateway_v2/package.json +++ b/examples/src/main/resources/gateway_v2/package.json @@ -10,8 +10,8 @@ "keywords": [], "license": "MIT", "dependencies": { - "@apollo/server": "4.9.5", - "@apollo/gateway": "2.6.2", + "@apollo/gateway": "2.8.0", + "@apollo/server": "4.10.4", "graphql": "16.8.1" } } diff --git a/federation/src/main/scala/caliban/federation/package.scala b/federation/src/main/scala/caliban/federation/package.scala index d7405ad79c..59a3ab4def 100644 --- a/federation/src/main/scala/caliban/federation/package.scala +++ b/federation/src/main/scala/caliban/federation/package.scala @@ -4,6 +4,7 @@ import caliban.federation.v2x.{ FederationDirectivesV2_3, FederationDirectivesV2_5, FederationDirectivesV2_6, + FederationDirectivesV2_8, FederationV2, Versions } @@ -17,5 +18,7 @@ package object federation { lazy val v2_4 = new FederationV2(List(Versions.v2_4)) with FederationDirectivesV2_3 lazy val v2_5 = new FederationV2(List(Versions.v2_5)) with FederationDirectivesV2_5 lazy val v2_6 = new FederationV2(List(Versions.v2_6)) with FederationDirectivesV2_6 + lazy val v2_7 = new FederationV2(List(Versions.v2_7)) with FederationDirectivesV2_6 + lazy val v2_8 = new FederationV2(List(Versions.v2_8)) with FederationDirectivesV2_8 } diff --git a/federation/src/main/scala/caliban/federation/v2x/FederationDirectivesV2_8.scala b/federation/src/main/scala/caliban/federation/v2x/FederationDirectivesV2_8.scala new file mode 100644 index 0000000000..129de86672 --- /dev/null +++ b/federation/src/main/scala/caliban/federation/v2x/FederationDirectivesV2_8.scala @@ -0,0 +1,16 @@ +package caliban.federation.v2x + +import caliban.Value.StringValue +import caliban.parsing.adt.Directive +import caliban.schema.Annotations.GQLDirective + +trait FederationDirectivesV2_8 extends FederationDirectivesV2_6 { + + def Context(context: String) = Directive("context", Map("context" -> StringValue(context))) + + case class GQLContext(context: String) extends GQLDirective(Context(context)) + + def FromContext(context: String) = Directive("fromContext", Map("context" -> StringValue(context))) + + case class GQLFromContext(context: String) extends GQLDirective(FromContext(context)) +} diff --git a/federation/src/main/scala/caliban/federation/v2x/FederationV2.scala b/federation/src/main/scala/caliban/federation/v2x/FederationV2.scala index 8716756b79..e6f6a782f3 100644 --- a/federation/src/main/scala/caliban/federation/v2x/FederationV2.scala +++ b/federation/src/main/scala/caliban/federation/v2x/FederationV2.scala @@ -52,4 +52,14 @@ object FederationV2 { `import` = v2_5.`import` :+ Import("@policy") ) + private[v2x] val v2_7 = Link( + url = s"$federationV2Url/v2.7", + `import` = v2_6.`import` + ) + + private[v2x] val v2_8 = Link( + url = s"$federationV2Url/v2.8", + `import` = v2_7.`import` :+ Import("@context") :+ Import("@fromContext") + ) + } diff --git a/federation/src/main/scala/caliban/federation/v2x/Versions.scala b/federation/src/main/scala/caliban/federation/v2x/Versions.scala index 4e01494b35..9e464f8a5a 100644 --- a/federation/src/main/scala/caliban/federation/v2x/Versions.scala +++ b/federation/src/main/scala/caliban/federation/v2x/Versions.scala @@ -8,5 +8,7 @@ object Versions { val v2_4 = FederationV2.v2_4 val v2_5 = FederationV2.v2_5 val v2_6 = FederationV2.v2_6 + val v2_7 = FederationV2.v2_7 + val v2_8 = FederationV2.v2_8 }