Skip to content

Commit

Permalink
Merge pull request #11 from graphql-python/main
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
abhinand-c authored Jun 13, 2023
2 parents 35532b1 + 07f42ce commit 13faef1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions graphene_federation/extend.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, Callable
from typing import Any, Callable, Dict

from graphene import Schema

from graphene_federation.utils import check_fields_exist_on_type, is_valid_compound_key


def get_extended_types(schema: Schema) -> dict[str, Any]:
def get_extended_types(schema: Schema) -> Dict[str, Any]:
"""
Find all the extended types from the schema.
They can be easily distinguished from the other type as
Expand Down
4 changes: 2 additions & 2 deletions graphene_federation/inaccessible.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, Optional
from typing import Any, Dict, Optional

from graphene import Schema

from graphene_federation.utils import get_attributed_fields


def get_inaccessible_types(schema: Schema) -> dict[str, Any]:
def get_inaccessible_types(schema: Schema) -> Dict[str, Any]:
"""
Find all the inaccessible types from the schema.
They can be easily distinguished from the other type as
Expand Down
4 changes: 2 additions & 2 deletions graphene_federation/requires.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Union
from typing import List, Union

from graphene import Schema

from graphene_federation.utils import get_attributed_fields


def requires(field, fields: Union[str, list[str]]):
def requires(field, fields: Union[str, List[str]]):
"""
Mark the required fields for a given field.
The input `fields` can be either a string or a list.
Expand Down
3 changes: 2 additions & 1 deletion graphene_federation/service.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
from typing import List

from graphene.types.interface import InterfaceOptions
from graphene.types.union import UnionOptions
Expand Down Expand Up @@ -31,7 +32,7 @@ def __init__(self, name, field):
self.fields = {name: field}


def convert_fields(schema: Schema, fields: list[str]) -> str:
def convert_fields(schema: Schema, fields: List[str]) -> str:
get_field_name = type_attribute_to_field_name(schema)
return " ".join([get_field_name(field) for field in fields])

Expand Down
4 changes: 2 additions & 2 deletions graphene_federation/shareable.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import Any, Optional
from typing import Any, Dict, Optional

from graphene import Schema
from graphene.types.interface import InterfaceOptions

from graphene_federation.utils import get_attributed_fields


def get_shareable_types(schema: Schema) -> dict[str, Any]:
def get_shareable_types(schema: Schema) -> Dict[str, Any]:
"""
Find all the extended types from the schema.
They can be easily distinguished from the other type as
Expand Down
4 changes: 2 additions & 2 deletions graphene_federation/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable
from typing import Any, Callable, List, Tuple

import graphene
from graphene import Schema, ObjectType
Expand Down Expand Up @@ -43,7 +43,7 @@ def is_valid_compound_key(type_name: str, key: str, schema: Schema):
key_document = parse(f"{{{key}}}")

# List storing tuples of nodes in the key document with its parent types
key_nodes: list[tuple[Any, GrapheneObjectType]] = [
key_nodes: List[Tuple[Any, GrapheneObjectType]] = [
(key_document.definitions[0], schema.graphql_schema.type_map[type_name])
]

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()

version = '3.1.3'
version = '3.1.4'

tests_require = [
"pytest==7.1.2",
Expand Down

0 comments on commit 13faef1

Please sign in to comment.