Skip to content

Commit

Permalink
bump: graphene directives
Browse files Browse the repository at this point in the history
  • Loading branch information
mak626 committed Jan 15, 2024
1 parent e1d8343 commit f2239ca
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions graphene_federation/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f2239ca

Please sign in to comment.