mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-19 04:22:25 +03:00
com2ann: Translate type comments into Python type annotations
This commit is contained in:
parent
d46332bd94
commit
e919260511
|
@ -16,7 +16,7 @@ EnumType = type(PyEnum)
|
||||||
|
|
||||||
|
|
||||||
class EnumOptions(BaseOptions):
|
class EnumOptions(BaseOptions):
|
||||||
enum: Enum = None
|
enum: PyEnum = None
|
||||||
deprecation_reason = None
|
deprecation_reason = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,6 @@ if MYPY:
|
||||||
from typing import Dict, Callable # NOQA
|
from typing import Dict, Callable # NOQA
|
||||||
|
|
||||||
|
|
||||||
class InputObjectTypeOptions(BaseOptions):
|
|
||||||
fields: Dict[str, InputField] = None
|
|
||||||
container: InputObjectTypeContainer = None
|
|
||||||
|
|
||||||
|
|
||||||
class InputObjectTypeContainer(dict, BaseType):
|
class InputObjectTypeContainer(dict, BaseType):
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
@ -27,6 +22,11 @@ class InputObjectTypeContainer(dict, BaseType):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class InputObjectTypeOptions(BaseOptions):
|
||||||
|
fields: Dict[str, InputField] = None
|
||||||
|
container: InputObjectTypeContainer = None
|
||||||
|
|
||||||
|
|
||||||
class InputObjectType(UnmountedType, BaseType):
|
class InputObjectType(UnmountedType, BaseType):
|
||||||
"""
|
"""
|
||||||
Input Object Type Definition
|
Input Object Type Definition
|
||||||
|
|
|
@ -8,11 +8,6 @@ if MYPY:
|
||||||
from typing import Dict, Iterable, Type # NOQA
|
from typing import Dict, Iterable, Type # NOQA
|
||||||
|
|
||||||
|
|
||||||
class InterfaceOptions(BaseOptions):
|
|
||||||
fields: Dict[str, Field] = None
|
|
||||||
interfaces: Iterable[Type[Interface]] = ()
|
|
||||||
|
|
||||||
|
|
||||||
class Interface(BaseType):
|
class Interface(BaseType):
|
||||||
"""
|
"""
|
||||||
Interface Type Definition
|
Interface Type Definition
|
||||||
|
@ -73,3 +68,8 @@ class Interface(BaseType):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
raise Exception("An Interface cannot be initialized")
|
raise Exception("An Interface cannot be initialized")
|
||||||
|
|
||||||
|
|
||||||
|
class InterfaceOptions(BaseOptions):
|
||||||
|
fields: Dict[str, Field] = None
|
||||||
|
interfaces: Iterable[Type[Interface]] = ()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user