From f2239ca2a864a5f41e89bb612374a4749ee601f4 Mon Sep 17 00:00:00 2001 From: M Aswin Kishore <60577077+mak626@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:28:20 +0530 Subject: [PATCH] bump: graphene directives --- graphene_federation/main.py | 29 +++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/graphene_federation/main.py b/graphene_federation/main.py index ce88548..90d44fd 100644 --- a/graphene_federation/main.py +++ b/graphene_federation/main.py @@ -43,11 +43,39 @@ def build_schema( subscription: Union[ObjectType, Type[ObjectType]] = None, types: Collection[Union[ObjectType, Type[ObjectType]]] = None, directives: Union[Collection[FederationDirective], None] = None, + include_graphql_spec_directives: bool = True, schema_directives: Collection[SchemaDirective] = None, auto_camelcase: bool = True, enable_federation_2: bool = True, federation_version: FederationVersion = None, ) -> Schema: + """ + Build Schema. + + Args: + query (Type[ObjectType]): Root query *ObjectType*. Describes entry point for fields to *read* + data in your Schema. + mutation (Optional[Type[ObjectType]]): Root mutation *ObjectType*. Describes entry point for + fields to *create, update or delete* data in your API. + subscription (Optional[Type[ObjectType]]): Root subscription *ObjectType*. Describes entry point + for fields to receive continuous updates. + types (Optional[Collection[Type[ObjectType]]]): List of any types to include in schema that + may not be introspected through root types. + directives (List[GraphQLDirective], optional): List of custom directives to include in the + GraphQL schema. + auto_camelcase (bool): Fieldnames will be transformed in Schema's TypeMap from snake_case + to camelCase (preferred by GraphQL standard). Default True. + schema_directives (Collection[SchemaDirective]): Directives that can be defined at DIRECTIVE_LOCATION.SCHEMA + with their argument values. + include_graphql_spec_directives (bool): Includes directives defined by GraphQL spec (@include, @skip, + @deprecated, @specifiedBy) + enable_federation_2 (bool): Whether to enable federation 2 directives (default LATEST_VERSION) + federation_version (FederationVersion): Specify the version explicit (default LATEST_VERSION) + + In case both enable_federation_2 and federation_version are specified, federation_version is given + higher priority + """ + federation_version = ( federation_version if federation_version @@ -70,6 +98,7 @@ def build_schema( "types": _types, "directives": _directives.values(), "auto_camelcase": auto_camelcase, + "include_graphql_spec_directives": include_graphql_spec_directives, } schema: Schema = build_directive_schema(query=query, **schema_args) diff --git a/setup.py b/setup.py index 1e92a2b..bdb16b8 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ def read(*rnames): install_requires=[ "graphene>=3.1", "graphql-core>=3.1", - "graphene-directives>=0.4.4", + "graphene-directives>=0.4.5", ], classifiers=[ "Development Status :: 5 - Production/Stable",