diff --git a/federation_spec/federation-v2.4.graphql b/federation_spec/federation-v2.4.graphql new file mode 100644 index 0000000..8bf0015 --- /dev/null +++ b/federation_spec/federation-v2.4.graphql @@ -0,0 +1,32 @@ +directive @composeDirective(name: String!) repeatable on SCHEMA +directive @extends on OBJECT | INTERFACE +directive @external on OBJECT | FIELD_DEFINITION +directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE +directive @inaccessible on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | UNION + | ENUM + | ENUM_VALUE + | SCALAR + | INPUT_OBJECT + | INPUT_FIELD_DEFINITION + | ARGUMENT_DEFINITION +directive @interfaceObject on OBJECT +directive @override(from: String!) on FIELD_DEFINITION +directive @provides(fields: FieldSet!) on FIELD_DEFINITION +directive @requires(fields: FieldSet!) on FIELD_DEFINITION +directive @shareable repeatable on FIELD_DEFINITION | OBJECT +directive @tag(name: String!) repeatable on + | FIELD_DEFINITION + | INTERFACE + | OBJECT + | UNION + | ARGUMENT_DEFINITION + | SCALAR + | ENUM + | ENUM_VALUE + | INPUT_OBJECT + | INPUT_FIELD_DEFINITION +scalar FieldSet diff --git a/federation_spec/federation-v2.5.graphql b/federation_spec/federation-v2.5.graphql new file mode 100644 index 0000000..6089be2 --- /dev/null +++ b/federation_spec/federation-v2.5.graphql @@ -0,0 +1,45 @@ +directive @composeDirective(name: String!) repeatable on SCHEMA +directive @extends on OBJECT | INTERFACE +directive @external on OBJECT | FIELD_DEFINITION +directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE +directive @inaccessible on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | UNION + | ENUM + | ENUM_VALUE + | SCALAR + | INPUT_OBJECT + | INPUT_FIELD_DEFINITION + | ARGUMENT_DEFINITION +directive @interfaceObject on OBJECT +directive @override(from: String!) on FIELD_DEFINITION +directive @provides(fields: FieldSet!) on FIELD_DEFINITION +directive @requires(fields: FieldSet!) on FIELD_DEFINITION +directive @shareable repeatable on FIELD_DEFINITION | OBJECT +directive @tag(name: String!) repeatable on + | FIELD_DEFINITION + | INTERFACE + | OBJECT + | UNION + | ARGUMENT_DEFINITION + | SCALAR + | ENUM + | ENUM_VALUE + | INPUT_OBJECT + | INPUT_FIELD_DEFINITION +directive @authenticated on + FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM +directive @requiresScopes(scopes: [[Scope!]!]!) on + FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM +scalar Scope +scalar FieldSet diff --git a/federation_spec/federation-v2.6.graphql b/federation_spec/federation-v2.6.graphql new file mode 100644 index 0000000..0151c2d --- /dev/null +++ b/federation_spec/federation-v2.6.graphql @@ -0,0 +1,52 @@ +directive @composeDirective(name: String!) repeatable on SCHEMA +directive @extends on OBJECT | INTERFACE +directive @external on OBJECT | FIELD_DEFINITION +directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE +directive @inaccessible on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | UNION + | ENUM + | ENUM_VALUE + | SCALAR + | INPUT_OBJECT + | INPUT_FIELD_DEFINITION + | ARGUMENT_DEFINITION +directive @interfaceObject on OBJECT +directive @override(from: String!) on FIELD_DEFINITION +directive @provides(fields: FieldSet!) on FIELD_DEFINITION +directive @requires(fields: FieldSet!) on FIELD_DEFINITION +directive @shareable repeatable on FIELD_DEFINITION | OBJECT +directive @tag(name: String!) repeatable on + | FIELD_DEFINITION + | INTERFACE + | OBJECT + | UNION + | ARGUMENT_DEFINITION + | SCALAR + | ENUM + | ENUM_VALUE + | INPUT_OBJECT + | INPUT_FIELD_DEFINITION +directive @authenticated on + FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM +directive @requiresScopes(scopes: [[Scope!]!]!) on + FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM +directive @policy(policies: [[federation__Policy!]!]!) on + | FIELD_DEFINITION + | OBJECT + | INTERFACE + | SCALAR + | ENUM +scalar federation__Policy +scalar Scope +scalar FieldSet diff --git a/graphene_federation/__init__.py b/graphene_federation/__init__.py index 524cac4..e4c45cc 100644 --- a/graphene_federation/__init__.py +++ b/graphene_federation/__init__.py @@ -2,14 +2,17 @@ from .apollo_versions import FederationVersion, LATEST_VERSION from .directives import ( + authenticated, extends, external, inaccessible, interface_object, key, override, + policy, provides, requires, + requires_scope, shareable, tag, ) @@ -24,6 +27,7 @@ "build_schema", "FederationDirective", "DirectiveLocation", + "authenticated", "extends", "external", "inaccessible", @@ -31,7 +35,9 @@ "key", "override", "provides", + "policy", "requires", + "requires_scope", "shareable", "tag", "compose_directive", diff --git a/graphene_federation/apollo_versions/__init__.py b/graphene_federation/apollo_versions/__init__.py index b2d4156..bd03dd4 100644 --- a/graphene_federation/apollo_versions/__init__.py +++ b/graphene_federation/apollo_versions/__init__.py @@ -5,9 +5,12 @@ from .v2_1 import get_directives as get_directives_v2_1 from .v2_2 import get_directives as get_directives_v2_2 from .v2_3 import get_directives as get_directives_v2_3 +from .v2_4 import get_directives as get_directives_v2_4 +from .v2_5 import get_directives as get_directives_v2_5 +from .v2_6 import get_directives as get_directives_v2_6 from .version import FederationVersion -LATEST_VERSION = FederationVersion.VERSION_2_3 +LATEST_VERSION = FederationVersion.VERSION_2_6 def get_directives_based_on_version( @@ -24,8 +27,14 @@ def get_directives_based_on_version( return get_directives_v2_2() case FederationVersion.VERSION_2_3: return get_directives_v2_3() + case FederationVersion.VERSION_2_4: + return get_directives_v2_4() + case FederationVersion.VERSION_2_5: + return get_directives_v2_5() + case FederationVersion.VERSION_2_6: + return get_directives_v2_6() case _: - return get_directives_v2_3() + return get_directives_v2_6() def get_directive_from_name( diff --git a/graphene_federation/apollo_versions/v2_4.py b/graphene_federation/apollo_versions/v2_4.py new file mode 100644 index 0000000..194f22c --- /dev/null +++ b/graphene_federation/apollo_versions/v2_4.py @@ -0,0 +1,8 @@ +from graphql import GraphQLDirective + +from .v2_3 import get_directives as get_directives_v2_3 + + +# No Change, Added Subscription Support +def get_directives() -> dict[str, GraphQLDirective]: + return get_directives_v2_3() diff --git a/graphene_federation/apollo_versions/v2_5.py b/graphene_federation/apollo_versions/v2_5.py new file mode 100644 index 0000000..efe9d8e --- /dev/null +++ b/graphene_federation/apollo_versions/v2_5.py @@ -0,0 +1,50 @@ +from graphene_directives import CustomDirective, DirectiveLocation +from graphql import GraphQLArgument, GraphQLDirective, GraphQLList, GraphQLNonNull + +from .v2_4 import get_directives as get_directives_v2_4 +from ..scalars import Scope + +authenticated_directive = CustomDirective( + name="authenticated", + locations=[ + DirectiveLocation.FIELD_DEFINITION, + DirectiveLocation.OBJECT, + DirectiveLocation.INTERFACE, + DirectiveLocation.SCALAR, + DirectiveLocation.ENUM, + ], + description="Federation @authenticated directive", + add_definition_to_schema=False, +) + +requires_scope_directive = CustomDirective( + name="requiresScopes", + locations=[ + DirectiveLocation.FIELD_DEFINITION, + DirectiveLocation.OBJECT, + DirectiveLocation.INTERFACE, + DirectiveLocation.SCALAR, + DirectiveLocation.ENUM, + ], + args={ + "scopes": GraphQLArgument( + GraphQLNonNull( + GraphQLList(GraphQLNonNull(GraphQLList(GraphQLNonNull(Scope)))) + ) + ), + }, + description="Federation @requiresScopes directive", + add_definition_to_schema=False, +) + + +# No Change, Added Subscription Support +def get_directives() -> dict[str, GraphQLDirective]: + directives = get_directives_v2_4() + directives.update( + { + directive.name: directive + for directive in [authenticated_directive, requires_scope_directive] + } + ) + return directives diff --git a/graphene_federation/apollo_versions/v2_6.py b/graphene_federation/apollo_versions/v2_6.py new file mode 100644 index 0000000..3375292 --- /dev/null +++ b/graphene_federation/apollo_versions/v2_6.py @@ -0,0 +1,34 @@ +from graphene_directives import CustomDirective, DirectiveLocation +from graphql import GraphQLArgument, GraphQLDirective, GraphQLList, GraphQLNonNull + +from .v2_5 import get_directives as get_directives_v2_5 +from ..scalars import FederationPolicy + +policy_directive = CustomDirective( + name="policy", + locations=[ + DirectiveLocation.FIELD_DEFINITION, + DirectiveLocation.OBJECT, + DirectiveLocation.INTERFACE, + DirectiveLocation.SCALAR, + DirectiveLocation.ENUM, + ], + args={ + "policies": GraphQLArgument( + GraphQLNonNull( + GraphQLList( + GraphQLNonNull(GraphQLList(GraphQLNonNull(FederationPolicy))) + ) + ) + ), + }, + description="Federation @policy directive", + add_definition_to_schema=False, +) + + +# No Change, Added Subscription Support +def get_directives() -> dict[str, GraphQLDirective]: + directives = get_directives_v2_5() + directives.update({directive.name: directive for directive in [policy_directive]}) + return directives diff --git a/graphene_federation/apollo_versions/version.py b/graphene_federation/apollo_versions/version.py index bd5d811..ce2c0e7 100644 --- a/graphene_federation/apollo_versions/version.py +++ b/graphene_federation/apollo_versions/version.py @@ -7,3 +7,6 @@ class FederationVersion(Enum): VERSION_2_1 = "2.1" VERSION_2_2 = "2.2" VERSION_2_3 = "2.3" + VERSION_2_4 = "2.4" + VERSION_2_5 = "2.5" + VERSION_2_6 = "2.6" diff --git a/graphene_federation/directives/__init__.py b/graphene_federation/directives/__init__.py index e57b374..c07e952 100644 --- a/graphene_federation/directives/__init__.py +++ b/graphene_federation/directives/__init__.py @@ -1,10 +1,13 @@ +from .authenticated import authenticated from .extends import extends from .external import external from .inaccessible import inaccessible from .interface_object import interface_object from .key import key from .override import override +from .policy import policy from .provides import provides from .requires import requires +from .requires_scopes import requires_scope from .shareable import shareable from .tag import tag diff --git a/graphene_federation/directives/authenticated.py b/graphene_federation/directives/authenticated.py new file mode 100644 index 0000000..c616fad --- /dev/null +++ b/graphene_federation/directives/authenticated.py @@ -0,0 +1,20 @@ +from typing import Any, Callable + +from graphene_directives import directive_decorator + +from .utils import is_non_field +from ..apollo_versions import FederationVersion, LATEST_VERSION, get_directive_from_name + + +def authenticated( + field: Any = None, + *, + federation_version: FederationVersion = LATEST_VERSION, +) -> Callable: + directive = get_directive_from_name( + "authenticated", federation_version=federation_version + ) + decorator = directive_decorator(directive) + return ( + decorator(field=None)(field) if is_non_field(field) else decorator(field=field) + ) diff --git a/graphene_federation/directives/policy.py b/graphene_federation/directives/policy.py new file mode 100644 index 0000000..3cb51ff --- /dev/null +++ b/graphene_federation/directives/policy.py @@ -0,0 +1,21 @@ +from typing import Any, Callable + +from graphene_directives import directive_decorator + +from .utils import is_non_field +from ..apollo_versions import FederationVersion, LATEST_VERSION, get_directive_from_name + + +def policy( + field: Any = None, + *, + policies: list[list[str]], + federation_version: FederationVersion = LATEST_VERSION, +) -> Callable: + directive = get_directive_from_name("policy", federation_version=federation_version) + decorator = directive_decorator(directive) + return ( + decorator(field=None, policies=policies)(field) + if is_non_field(field) + else decorator(field=field, policies=policies) + ) diff --git a/graphene_federation/directives/requires_scopes.py b/graphene_federation/directives/requires_scopes.py new file mode 100644 index 0000000..80ec359 --- /dev/null +++ b/graphene_federation/directives/requires_scopes.py @@ -0,0 +1,23 @@ +from typing import Any, Callable + +from graphene_directives import directive_decorator + +from .utils import is_non_field +from ..apollo_versions import FederationVersion, LATEST_VERSION, get_directive_from_name + + +def requires_scope( + field: Any = None, + *, + scopes: list[list[str]], + federation_version: FederationVersion = LATEST_VERSION, +) -> Callable: + directive = get_directive_from_name( + "requiresScopes", federation_version=federation_version + ) + decorator = directive_decorator(directive) + return ( + decorator(field=None, scopes=scopes)(field) + if is_non_field(field) + else decorator(field=field, scopes=scopes) + ) diff --git a/graphene_federation/scalars/__init__.py b/graphene_federation/scalars/__init__.py index 9fb3066..bccde34 100644 --- a/graphene_federation/scalars/__init__.py +++ b/graphene_federation/scalars/__init__.py @@ -1,5 +1,7 @@ from ._any import _Any +from .federation_policy import FederationPolicy from .field_set_v1 import _FieldSet from .field_set_v2 import FieldSet from .link_import import link_import from .link_purpose import link_purpose +from .scope import Scope diff --git a/graphene_federation/scalars/federation_policy.py b/graphene_federation/scalars/federation_policy.py new file mode 100644 index 0000000..c456036 --- /dev/null +++ b/graphene_federation/scalars/federation_policy.py @@ -0,0 +1,51 @@ +from typing import Any + +from graphql import ( + GraphQLError, + GraphQLScalarType, + StringValueNode, + ValueNode, + print_ast, +) +from graphql.pyutils import inspect + + +def _serialize_string(output_value: Any) -> str: + if isinstance(output_value, str): + return output_value + # do not serialize builtin types as strings, but allow serialization of custom + # types via their `__str__` method + if type(output_value).__module__ == "builtins": + raise GraphQLError( + "federation__Policy cannot represent value: " + inspect(output_value) + ) + + return str(output_value) + + +def _coerce_string(input_value: Any) -> str: + if not isinstance(input_value, str): + raise GraphQLError( + "federation__Policy cannot represent a non string value: " + + inspect(input_value) + ) + return input_value + + +def _parse_string_literal(value_node: ValueNode, _variables: Any = None) -> str: + """Parse a string value node in the AST.""" + if not isinstance(value_node, StringValueNode): + raise GraphQLError( + "federation__Policy cannot represent a non string value: " + + print_ast(value_node), + value_node, + ) + return value_node.value + + +FederationPolicy = GraphQLScalarType( + name="federation__Policy", + serialize=_serialize_string, + parse_value=_coerce_string, + parse_literal=_parse_string_literal, +) diff --git a/graphene_federation/scalars/field_set_v1.py b/graphene_federation/scalars/field_set_v1.py index 3bd6d5a..747ca08 100644 --- a/graphene_federation/scalars/field_set_v1.py +++ b/graphene_federation/scalars/field_set_v1.py @@ -1,9 +1,3 @@ -from graphql import GraphQLString +from graphql import GraphQLScalarType -# _FieldSet = GraphQLScalarType(name="_FieldSet") - -""" -To avoid _FieldSet from coming into schema we are defining it as String -""" - -_FieldSet = GraphQLString +_FieldSet = GraphQLScalarType(name="_FieldSet") diff --git a/graphene_federation/scalars/field_set_v2.py b/graphene_federation/scalars/field_set_v2.py index 7e26458..a2a2939 100644 --- a/graphene_federation/scalars/field_set_v2.py +++ b/graphene_federation/scalars/field_set_v2.py @@ -1,9 +1,3 @@ -from graphql import GraphQLString +from graphql import GraphQLScalarType -# FieldSet = GraphQLScalarType(name="FieldSet") - -""" -To avoid FieldSet from coming into schema we are defining it as String -""" - -FieldSet = GraphQLString +FieldSet = GraphQLScalarType(name="FieldSet") diff --git a/graphene_federation/scalars/scope.py b/graphene_federation/scalars/scope.py new file mode 100644 index 0000000..dbaf26f --- /dev/null +++ b/graphene_federation/scalars/scope.py @@ -0,0 +1,47 @@ +from typing import Any + +from graphql import ( + GraphQLError, + GraphQLScalarType, + StringValueNode, + ValueNode, + print_ast, +) +from graphql.pyutils import inspect + + +def _serialize_string(output_value: Any) -> str: + if isinstance(output_value, str): + return output_value + # do not serialize builtin types as strings, but allow serialization of custom + # types via their `__str__` method + if type(output_value).__module__ == "builtins": + raise GraphQLError("Scope cannot represent value: " + inspect(output_value)) + + return str(output_value) + + +def _coerce_string(input_value: Any) -> str: + if not isinstance(input_value, str): + raise GraphQLError( + "Scope cannot represent a non string value: " + inspect(input_value) + ) + return input_value + + +def _parse_string_literal(value_node: ValueNode, _variables: Any = None) -> str: + """Parse a string value node in the AST.""" + if not isinstance(value_node, StringValueNode): + raise GraphQLError( + "Scope cannot represent a non string value: " + print_ast(value_node), + value_node, + ) + return value_node.value + + +Scope = GraphQLScalarType( + name="Scope", + serialize=_serialize_string, + parse_value=_coerce_string, + parse_literal=_parse_string_literal, +) diff --git a/tests/gql/test_annotation_corner_cases/test_annotate_object_with_meta_name_1.graphql b/tests/gql/test_annotation_corner_cases/test_annotate_object_with_meta_name_1.graphql index efe26ec..02c9630 100644 --- a/tests/gql/test_annotation_corner_cases/test_annotate_object_with_meta_name_1.graphql +++ b/tests/gql/test_annotation_corner_cases/test_annotate_object_with_meta_name_1.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@key"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@key"]) type Query { a: Banana @@ -22,4 +22,10 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_annotate_object_with_meta_name_2.graphql b/tests/gql/test_annotation_corner_cases/test_annotate_object_with_meta_name_2.graphql index 3af4f57..7d18cc1 100644 --- a/tests/gql/test_annotation_corner_cases/test_annotate_object_with_meta_name_2.graphql +++ b/tests/gql/test_annotation_corner_cases/test_annotate_object_with_meta_name_2.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@key"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@key"]) type Query { a: Banana @@ -12,4 +12,10 @@ type Banana @extends { type Potato @key(fields: "id") { id: ID -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_annotated_field_also_used_in_filter_1.graphql b/tests/gql/test_annotation_corner_cases/test_annotated_field_also_used_in_filter_1.graphql index 8c2fde0..c33e145 100644 --- a/tests/gql/test_annotation_corner_cases/test_annotated_field_also_used_in_filter_1.graphql +++ b/tests/gql/test_annotation_corner_cases/test_annotated_field_also_used_in_filter_1.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@key"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@key"]) type Query { a: A @@ -22,4 +22,10 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_annotated_field_also_used_in_filter_2.graphql b/tests/gql/test_annotation_corner_cases/test_annotated_field_also_used_in_filter_2.graphql index 30f8bbe..bca01c5 100644 --- a/tests/gql/test_annotation_corner_cases/test_annotated_field_also_used_in_filter_2.graphql +++ b/tests/gql/test_annotation_corner_cases/test_annotated_field_also_used_in_filter_2.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@key"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@key"]) type Query { a: A @@ -12,4 +12,10 @@ type A @extends { type B @key(fields: "id") { id: ID -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_1.graphql b/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_1.graphql index dad0a06..a8f41d7 100644 --- a/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_1.graphql +++ b/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_1.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@key", "@requires"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@key", "@requires"]) type Query { camel: Camel @@ -20,4 +20,10 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_2.graphql b/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_2.graphql index c492c80..3e56148 100644 --- a/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_2.graphql +++ b/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_2.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@key", "@requires"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@key", "@requires"]) type Query { camel: Camel @@ -10,4 +10,10 @@ type Camel @key(fields: "autoCamel") @extends { forcedCamel: String @requires(fields: "autoCamel") aSnake: String aCamel: String -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_without_auto_camelcase_1.graphql b/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_without_auto_camelcase_1.graphql index 19c3729..4475a5a 100644 --- a/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_without_auto_camelcase_1.graphql +++ b/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_without_auto_camelcase_1.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@requires"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@requires"]) type Query { camel: Camel @@ -20,4 +20,10 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_without_auto_camelcase_2.graphql b/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_without_auto_camelcase_2.graphql index c53e1d5..2599e85 100644 --- a/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_without_auto_camelcase_2.graphql +++ b/tests/gql/test_annotation_corner_cases/test_camel_case_field_name_without_auto_camelcase_2.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@requires"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@requires"]) type Query { camel: Camel @@ -10,4 +10,10 @@ type Camel @extends { forcedCamel: String @requires(fields: "auto_camel") a_snake: String aCamel: String -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_similar_field_name_1.graphql b/tests/gql/test_annotation_corner_cases/test_similar_field_name_1.graphql index f7227c6..74001b6 100644 --- a/tests/gql/test_annotation_corner_cases/test_similar_field_name_1.graphql +++ b/tests/gql/test_annotation_corner_cases/test_similar_field_name_1.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@key"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@key"]) schema { query: ChatQuery @@ -30,4 +30,10 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases/test_similar_field_name_2.graphql b/tests/gql/test_annotation_corner_cases/test_similar_field_name_2.graphql index f3a6094..0a81854 100644 --- a/tests/gql/test_annotation_corner_cases/test_similar_field_name_2.graphql +++ b/tests/gql/test_annotation_corner_cases/test_similar_field_name_2.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@extends", "@external", "@key"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@extends", "@external", "@key"]) schema { query: ChatQuery @@ -20,4 +20,10 @@ type ChatUser @key(fields: "id") @extends { id: ID @external iD: ID ID: ID -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_annotate_object_with_meta_name_1.graphql b/tests/gql/test_annotation_corner_cases_v1/test_annotate_object_with_meta_name_1.graphql index b2d0d44..33ea1a2 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_annotate_object_with_meta_name_1.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_annotate_object_with_meta_name_1.graphql @@ -19,4 +19,6 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_annotate_object_with_meta_name_2.graphql b/tests/gql/test_annotation_corner_cases_v1/test_annotate_object_with_meta_name_2.graphql index 24f6c7a..231213d 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_annotate_object_with_meta_name_2.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_annotate_object_with_meta_name_2.graphql @@ -9,4 +9,6 @@ type Banana @extends { type Potato @key(fields: "id") { id: ID -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_annotated_field_also_used_in_filter_1.graphql b/tests/gql/test_annotation_corner_cases_v1/test_annotated_field_also_used_in_filter_1.graphql index 6743c39..721113e 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_annotated_field_also_used_in_filter_1.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_annotated_field_also_used_in_filter_1.graphql @@ -19,4 +19,6 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_annotated_field_also_used_in_filter_2.graphql b/tests/gql/test_annotation_corner_cases_v1/test_annotated_field_also_used_in_filter_2.graphql index f06d78a..04f332e 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_annotated_field_also_used_in_filter_2.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_annotated_field_also_used_in_filter_2.graphql @@ -9,4 +9,6 @@ type A @extends { type B @key(fields: "id") { id: ID -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_1.graphql b/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_1.graphql index 75b54e6..0f68074 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_1.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_1.graphql @@ -17,4 +17,6 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_2.graphql b/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_2.graphql index 11e9b8d..7722ee0 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_2.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_2.graphql @@ -7,4 +7,6 @@ type Camel @key(fields: "autoCamel") @extends { forcedCamel: String @requires(fields: "autoCamel") aSnake: String aCamel: String -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_without_auto_camelcase_1.graphql b/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_without_auto_camelcase_1.graphql index 25aac2c..bf84d73 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_without_auto_camelcase_1.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_without_auto_camelcase_1.graphql @@ -17,4 +17,6 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_without_auto_camelcase_2.graphql b/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_without_auto_camelcase_2.graphql index 095afd2..059614d 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_without_auto_camelcase_2.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_camel_case_field_name_without_auto_camelcase_2.graphql @@ -7,4 +7,6 @@ type Camel @extends { forcedCamel: String @requires(fields: "auto_camel") a_snake: String aCamel: String -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_similar_field_name_1.graphql b/tests/gql/test_annotation_corner_cases_v1/test_similar_field_name_1.graphql index 3531b4d..2cbfefc 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_similar_field_name_1.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_similar_field_name_1.graphql @@ -27,4 +27,6 @@ scalar _Any type _Service { sdl: String -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_annotation_corner_cases_v1/test_similar_field_name_2.graphql b/tests/gql/test_annotation_corner_cases_v1/test_similar_field_name_2.graphql index 7bb2baa..2a39f29 100644 --- a/tests/gql/test_annotation_corner_cases_v1/test_similar_field_name_2.graphql +++ b/tests/gql/test_annotation_corner_cases_v1/test_similar_field_name_2.graphql @@ -17,4 +17,6 @@ type ChatUser @key(fields: "id") @extends { id: ID @external iD: ID ID: ID -} \ No newline at end of file +} + +scalar _FieldSet \ No newline at end of file diff --git a/tests/gql/test_custom_enum/test_custom_enum_1.graphql b/tests/gql/test_custom_enum/test_custom_enum_1.graphql index 4da9a1b..69b38f9 100644 --- a/tests/gql/test_custom_enum/test_custom_enum_1.graphql +++ b/tests/gql/test_custom_enum/test_custom_enum_1.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@inaccessible", "@shareable"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@inaccessible", "@shareable"]) type TestCustomEnum @shareable { testShareableScalar: Episode @shareable @@ -20,4 +20,10 @@ type Query { type _Service { sdl: String -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file diff --git a/tests/gql/test_custom_enum/test_custom_enum_2.graphql b/tests/gql/test_custom_enum/test_custom_enum_2.graphql index 30c6101..2eeaf13 100644 --- a/tests/gql/test_custom_enum/test_custom_enum_2.graphql +++ b/tests/gql/test_custom_enum/test_custom_enum_2.graphql @@ -1,5 +1,5 @@ extend schema - @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@inaccessible", "@shareable"]) + @link(url: "https://specs.apollo.dev/federation/v2.6", import: ["@inaccessible", "@shareable"]) type TestCustomEnum @shareable { testShareableScalar: Episode @shareable @@ -15,4 +15,10 @@ enum Episode @inaccessible { type Query { test: Episode test2: [TestCustomEnum]! -} \ No newline at end of file +} + +scalar FieldSet + +scalar Scope + +scalar federation__Policy \ No newline at end of file