From f37d6fabfecb29d85f1ef9610c9ae23886200148 Mon Sep 17 00:00:00 2001 From: Glen Date: Mon, 30 Sep 2024 22:31:15 +0200 Subject: [PATCH] Included tag directive in Apollo Federation import list (#7421) (cherry picked from commit d8b055a2453f4fd0e1ddfc585af3cee28df4b8fa) --- .../FederationTypeInterceptor.cs | 28 +++++++++++++++---- .../CertificationTests.Schema_Snapshot.snap | 2 +- .../CertificationTests.Subgraph_SDL.snap | 2 +- .../CertificationTests.Schema_Snapshot.snap | 2 +- .../CertificationTests.Subgraph_SDL.snap | 2 +- ...iceTypeEmptyQueryTypePureCodeFirst.graphql | 2 +- ...ExternalToTypeFieldAnnotationBased.graphql | 2 +- ...notateExternalToTypeFieldCodeFirst.graphql | 2 +- ...KeyToClassAttributeAnnotationBased.graphql | 2 +- ...eyToClassAttributesAnnotationBased.graphql | 2 +- ...InterfaceAttributesAnnotationBased.graphql | 2 +- ...nnotateKeyToInterfaceTypeCodeFirst.graphql | 2 +- ...tateKeyToObjectTypeAnnotationBased.graphql | 2 +- ...s.AnnotateKeyToObjectTypeCodeFirst.graphql | 2 +- ...KeyToClassAttributeAnnotationBased.graphql | 2 +- ...eyToClassAttributesAnnotationBased.graphql | 2 +- ...InterfaceAttributesAnnotationBased.graphql | 2 +- ...nnotateKeyToInterfaceTypeCodeFirst.graphql | 2 +- ...tateKeyToObjectTypeAnnotationBased.graphql | 2 +- ...s.AnnotateKeyToObjectTypeCodeFirst.graphql | 2 +- ...iveTests.OverrideDirective_Annotation.snap | 2 +- ...rrideDirective_Progressive_Annotation.snap | 2 +- ...ive_GetsAddedCorrectly_Annotations.graphql | 2 +- ...ives_GetAddedCorrectly_Annotations.graphql | 2 +- ...ctives_GetAddedCorrectly_CodeFirst.graphql | 2 +- ...videsToClassAttributePureCodeFirst.graphql | 2 +- ...s.AnnotateProvidesToFieldCodeFirst.graphql | 2 +- ...videsToClassAttributePureCodeFirst.graphql | 2 +- ...s.AnnotateProvidesToFieldCodeFirst.graphql | 2 +- ...ive_GetsAddedCorrectly_Annotations.graphql | 2 +- ...ives_GetAddedCorrectly_Annotations.graphql | 2 +- ...ctives_GetAddedCorrectly_CodeFirst.graphql | 2 +- .../ServiceTypeTests.cs | 4 +-- ...ests.Ensure_PagingInfo_Is_Sharable.graphql | 2 +- ...e_When_Sharable_Already_Registered.graphql | 2 +- 35 files changed, 57 insertions(+), 41 deletions(-) diff --git a/src/HotChocolate/ApolloFederation/src/ApolloFederation/FederationTypeInterceptor.cs b/src/HotChocolate/ApolloFederation/src/ApolloFederation/FederationTypeInterceptor.cs index 26c3a5d6f96..45fb663ae10 100644 --- a/src/HotChocolate/ApolloFederation/src/ApolloFederation/FederationTypeInterceptor.cs +++ b/src/HotChocolate/ApolloFederation/src/ApolloFederation/FederationTypeInterceptor.cs @@ -127,7 +127,8 @@ public override void OnAfterCompleteName( ITypeCompletionContext completionContext, DefinitionBase definition) { - if (definition is not ITypeDefinition and not DirectiveTypeDefinition) + if (_context.GetFederationVersion() == FederationVersion.Federation10 + || definition is not ITypeDefinition and not DirectiveTypeDefinition) { return; } @@ -161,16 +162,18 @@ public override void OnAfterCompleteName( if (type.IsDefined(typeof(PackageAttribute))) { RegisterImport(type); + return; } + + if (type == typeof(DirectiveType)) + { + RegisterTagImport(); + } + return; void RegisterImport(MemberInfo element) { - if (_context.GetFederationVersion() == FederationVersion.Federation10) - { - return; - } - var package = element.GetCustomAttribute(); if (package is null) @@ -193,6 +196,19 @@ void RegisterImport(MemberInfo element) types.Add(completionContext.Type.Name); } } + + void RegisterTagImport() + { + var packageUrl = FederationVersion.Federation20.ToUrl(); + + if (!_imports.TryGetValue(packageUrl, out var types)) + { + types = []; + _imports[packageUrl] = types; + } + + types.Add($"@{completionContext.Type.Name}"); + } } public override void OnTypesCompletedName() diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Schema_Snapshot.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Schema_Snapshot.snap index f4513dc7681..29383f074f9 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Schema_Snapshot.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Schema_Snapshot.snap @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@external", "@provides", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@tag", "@key", "@external", "@provides", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Subgraph_SDL.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Subgraph_SDL.snap index f4513dc7681..29383f074f9 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Subgraph_SDL.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/AnnotationBased/__snapshots__/CertificationTests.Subgraph_SDL.snap @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@external", "@provides", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@tag", "@key", "@external", "@provides", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Schema_Snapshot.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Schema_Snapshot.snap index 46dd915c0bc..6d0d1dd4b1c 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Schema_Snapshot.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Schema_Snapshot.snap @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@provides", "@external", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@tag", "@key", "@provides", "@external", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Subgraph_SDL.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Subgraph_SDL.snap index 46dd915c0bc..6d0d1dd4b1c 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Subgraph_SDL.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/CertificationSchema/CodeFirst/__snapshots__/CertificationTests.Subgraph_SDL.snap @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@provides", "@external", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@tag", "@key", "@provides", "@external", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.TestServiceTypeEmptyQueryTypePureCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.TestServiceTypeEmptyQueryTypePureCodeFirst.graphql index 657c3955c20..da0786b488a 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.TestServiceTypeEmptyQueryTypePureCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ComposeDirectiveTests.TestServiceTypeEmptyQueryTypePureCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @composeDirective(name: "custom") @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet", "@composeDirective" ]) @link(url: "https:\/\/specs.custom.dev\/custom\/v1.0", import: [ "@custom" ]) { +schema @composeDirective(name: "custom") @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet", "@composeDirective" ]) @link(url: "https:\/\/specs.custom.dev\/custom\/v1.0", import: [ "@custom" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql index 1d8c2ae8af9..1c198381b69 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@external", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@external", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql index a346436b10b..ba4d5cb570d 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ExternalDirectiveTests.AnnotateExternalToTypeFieldCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@external", "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@external", "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql index 92904f7d7a5..a46ca1b71e3 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: QueryOfTestTypePropertyDirective } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql index 4ca01a79826..1839bd893fd 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: QueryOfTestTypePropertyDirectives } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql index b6cdb413d2c..e448bba674a 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: QueryOfTestTypeClassDirective } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql index 9b0d07316ba..b1e69891b4b 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql index d617f06fae5..a81e78cb445 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: QueryOfTestTypeClassDirective } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql index 0bf1e9a3d0b..c6e684063e1 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/KeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql index 001c1ed1083..04ac822c43d 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributeAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: QueryOfTestTypePropertyDirective } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql index 59cee9c7e73..61d772118cd 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToClassAttributesAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: QueryOfTestTypePropertyDirectives } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql index 05c596f5ed0..2b616b6e08b 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceAttributesAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: QueryOfTestTypeClassDirective } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql index e4efebb68f2..d30f9f7675e 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToInterfaceTypeCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql index 646a86b6ac9..125a39f476b 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeAnnotationBased.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: QueryOfTestTypeClassDirective } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql index eaadcf45c20..dc014fb1937 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/NonResolvableKeyDirectiveTests.AnnotateKeyToObjectTypeCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Annotation.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Annotation.snap index 4b493b6537a..90bb3e041cc 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Annotation.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Annotation.snap @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.0", import: [ "@key", "@override", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.0", import: [ "@key", "@override", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Progressive_Annotation.snap b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Progressive_Annotation.snap index 6811fa4c91d..8f5a8cb9aa2 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Progressive_Annotation.snap +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/OverrideDirectiveTests.OverrideDirective_Progressive_Annotation.snap @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.7", import: [ "@key", "@override", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.7", import: [ "@key", "@override", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirective_GetsAddedCorrectly_Annotations.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirective_GetsAddedCorrectly_Annotations.graphql index 4ac3ad28424..2f166fc7998 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirective_GetsAddedCorrectly_Annotations.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirective_GetsAddedCorrectly_Annotations.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet", "@policy" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet", "@policy" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_Annotations.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_Annotations.graphql index 4ac3ad28424..2f166fc7998 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_Annotations.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_Annotations.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet", "@policy" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet", "@policy" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_CodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_CodeFirst.graphql index 6098ba8ce07..00aa253f46f 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_CodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/PolicyDirectiveTests.PolicyDirectives_GetAddedCorrectly_CodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@policy", "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@policy", "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql index 46b087a2eed..ca96d395894 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@provides", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@provides", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql index c8bcdf300f0..76d4a70aed8 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/ProvidesDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@provides", "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@provides", "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql index 42a686b7cee..6c888376617 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToClassAttributePureCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@requires", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@requires", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql index c61ba77ee5c..e585c700436 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresDirectiveTests.AnnotateProvidesToFieldCodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@requires", "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@requires", "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirective_GetsAddedCorrectly_Annotations.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirective_GetsAddedCorrectly_Annotations.graphql index a7b5c72ed87..7540567cd2c 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirective_GetsAddedCorrectly_Annotations.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirective_GetsAddedCorrectly_Annotations.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet", "@requiresScopes" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet", "@requiresScopes" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_Annotations.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_Annotations.graphql index a7b5c72ed87..7540567cd2c 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_Annotations.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_Annotations.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet", "@requiresScopes" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet", "@requiresScopes" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_CodeFirst.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_CodeFirst.graphql index 26c0e130ddb..f4ee4435310 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_CodeFirst.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/Directives/__snapshots__/RequiresScopesDirectiveTests.RequiresScopesDirectives_GetAddedCorrectly_CodeFirst.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@requiresScopes", "@key", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@requiresScopes", "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ServiceTypeTests.cs b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ServiceTypeTests.cs index fe51807dc7f..6d7b7dbbe0c 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ServiceTypeTests.cs +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ServiceTypeTests.cs @@ -33,7 +33,7 @@ public async Task TestServiceTypeEmptyQueryTypePureCodeFirst() .Parse((string)value!) .MatchInlineSnapshot( """ - schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "FieldSet" ]) { + schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@key", "@tag", "FieldSet" ]) { query: Query } @@ -89,7 +89,7 @@ public async Task TestServiceTypeTypePureCodeFirst() .Parse((string)value!) .MatchInlineSnapshot( """ - schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.2", import: [ "@key", "FieldSet" ]) { + schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.2", import: [ "@key", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesSharableTests.Ensure_PagingInfo_Is_Sharable.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesSharableTests.Ensure_PagingInfo_Is_Sharable.graphql index ac877e90af5..2e92bc7ce0c 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesSharableTests.Ensure_PagingInfo_Is_Sharable.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesSharableTests.Ensure_PagingInfo_Is_Sharable.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@shareable", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@shareable", "@tag", "FieldSet" ]) { query: Query } diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesSharableTests.Ensure_PagingInfo_Is_Sharable_When_Sharable_Already_Registered.graphql b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesSharableTests.Ensure_PagingInfo_Is_Sharable_When_Sharable_Already_Registered.graphql index ac877e90af5..2e92bc7ce0c 100644 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesSharableTests.Ensure_PagingInfo_Is_Sharable_When_Sharable_Already_Registered.graphql +++ b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/__snapshots__/BuiltInTypesSharableTests.Ensure_PagingInfo_Is_Sharable_When_Sharable_Already_Registered.graphql @@ -1,4 +1,4 @@ -schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@shareable", "FieldSet" ]) { +schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.6", import: [ "@shareable", "@tag", "FieldSet" ]) { query: Query }