mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 15:10:48 +03:00
Add reorder-python-imports pre-commit hook and run on all files
This commit is contained in:
parent
28f6353212
commit
d4418c9d02
|
@ -15,3 +15,7 @@
|
|||
- id: pretty-format-json
|
||||
args:
|
||||
- --autofix
|
||||
- repo: git://github.com/asottile/reorder_python_imports
|
||||
sha: v0.3.2
|
||||
hooks:
|
||||
- id: reorder-python-imports
|
||||
|
|
|
@ -207,7 +207,7 @@ Before:
|
|||
```python
|
||||
class SomeMutation(Mutation):
|
||||
...
|
||||
|
||||
|
||||
@classmethod
|
||||
def mutate(cls, instance, args, context, info):
|
||||
...
|
||||
|
@ -218,7 +218,7 @@ With 2.0:
|
|||
```python
|
||||
class SomeMutation(Mutation):
|
||||
...
|
||||
|
||||
|
||||
def mutate(self, info, **args):
|
||||
...
|
||||
```
|
||||
|
@ -231,7 +231,7 @@ class SomeMutation(Mutation):
|
|||
first_name = String(required=True)
|
||||
last_name = String(required=True)
|
||||
...
|
||||
|
||||
|
||||
def mutate(self, info, first_name, last_name):
|
||||
...
|
||||
```
|
||||
|
@ -250,7 +250,7 @@ If you are using Middelwares, you need to some adjustments:
|
|||
Before:
|
||||
|
||||
```python
|
||||
class MyGrapheneMiddleware(object):
|
||||
class MyGrapheneMiddleware(object):
|
||||
def resolve(self, next_mw, root, args, context, info):
|
||||
|
||||
## Middleware code
|
||||
|
@ -261,7 +261,7 @@ class MyGrapheneMiddleware(object):
|
|||
With 2.0:
|
||||
|
||||
```python
|
||||
class MyGrapheneMiddleware(object):
|
||||
class MyGrapheneMiddleware(object):
|
||||
def resolve(self, next_mw, root, info, **args):
|
||||
context = info.context
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import graphene
|
||||
|
||||
from .data import get_character, get_droid, get_hero, get_human
|
||||
from .data import get_character
|
||||
from .data import get_droid
|
||||
from .data import get_hero
|
||||
from .data import get_human
|
||||
|
||||
|
||||
class Episode(graphene.Enum):
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from graphene.test import Client
|
||||
|
||||
from ..data import setup
|
||||
from ..schema import schema
|
||||
from graphene.test import Client
|
||||
|
||||
setup()
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import graphene
|
||||
from .data import create_ship
|
||||
from .data import get_empire
|
||||
from .data import get_faction
|
||||
from .data import get_rebels
|
||||
from .data import get_ship
|
||||
from graphene import relay
|
||||
|
||||
from .data import create_ship, get_empire, get_faction, get_rebels, get_ship
|
||||
|
||||
|
||||
class Ship(graphene.ObjectType):
|
||||
'''A ship in the Star Wars saga'''
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from graphene.test import Client
|
||||
|
||||
from ..data import setup
|
||||
from ..schema import schema
|
||||
from graphene.test import Client
|
||||
|
||||
setup()
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from graphene.test import Client
|
||||
|
||||
from ..data import setup
|
||||
from ..schema import schema
|
||||
from graphene.test import Client
|
||||
|
||||
setup()
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from graphene.test import Client
|
||||
|
||||
from ..data import setup
|
||||
from ..schema import schema
|
||||
from graphene.test import Client
|
||||
|
||||
setup()
|
||||
|
||||
|
|
|
@ -1,38 +1,40 @@
|
|||
from .pyutils.version import get_version
|
||||
|
||||
from .types import (
|
||||
AbstractType,
|
||||
ObjectType,
|
||||
InputObjectType,
|
||||
Interface,
|
||||
Mutation,
|
||||
Field,
|
||||
InputField,
|
||||
Schema,
|
||||
Scalar,
|
||||
String, ID, Int, Float, Boolean,
|
||||
Date, DateTime, Time,
|
||||
JSONString,
|
||||
UUID,
|
||||
List, NonNull,
|
||||
Enum,
|
||||
Argument,
|
||||
Dynamic,
|
||||
Union,
|
||||
Context,
|
||||
ResolveInfo
|
||||
)
|
||||
from .relay import (
|
||||
Node,
|
||||
is_node,
|
||||
GlobalID,
|
||||
ClientIDMutation,
|
||||
Connection,
|
||||
ConnectionField,
|
||||
PageInfo
|
||||
)
|
||||
from .utils.resolve_only_args import resolve_only_args
|
||||
from .relay import ClientIDMutation
|
||||
from .relay import Connection
|
||||
from .relay import ConnectionField
|
||||
from .relay import GlobalID
|
||||
from .relay import is_node
|
||||
from .relay import Node
|
||||
from .relay import PageInfo
|
||||
from .types import AbstractType
|
||||
from .types import Argument
|
||||
from .types import Boolean
|
||||
from .types import Context
|
||||
from .types import Date
|
||||
from .types import DateTime
|
||||
from .types import Dynamic
|
||||
from .types import Enum
|
||||
from .types import Field
|
||||
from .types import Float
|
||||
from .types import ID
|
||||
from .types import InputField
|
||||
from .types import InputObjectType
|
||||
from .types import Int
|
||||
from .types import Interface
|
||||
from .types import JSONString
|
||||
from .types import List
|
||||
from .types import Mutation
|
||||
from .types import NonNull
|
||||
from .types import ObjectType
|
||||
from .types import ResolveInfo
|
||||
from .types import Scalar
|
||||
from .types import Schema
|
||||
from .types import String
|
||||
from .types import Time
|
||||
from .types import Union
|
||||
from .types import UUID
|
||||
from .utils.module_loading import lazy_import
|
||||
from .utils.resolve_only_args import resolve_only_args
|
||||
|
||||
|
||||
VERSION = (2, 1, 0, 'final', 0)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import six
|
||||
|
||||
try:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
"""Python Enumerations"""
|
||||
|
||||
import sys as _sys
|
||||
|
||||
__all__ = ['Enum', 'IntEnum', 'unique']
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
Back port of Python 3.3's function signature tools from the inspect module,
|
||||
modified to be compatible with Python 2.7 and 3.2+.
|
||||
"""
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import itertools
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import functools
|
||||
import itertools
|
||||
import re
|
||||
import types
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
__version__ = "0.4"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from ..enum import _is_dunder, _is_sunder
|
||||
from ..enum import _is_dunder
|
||||
from ..enum import _is_sunder
|
||||
|
||||
|
||||
def test__is_dunder():
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
from .node import Node, is_node, GlobalID
|
||||
from .connection import Connection
|
||||
from .connection import ConnectionField
|
||||
from .connection import PageInfo
|
||||
from .mutation import ClientIDMutation
|
||||
from .connection import Connection, ConnectionField, PageInfo
|
||||
from .node import GlobalID
|
||||
from .node import is_node
|
||||
from .node import Node
|
||||
|
||||
__all__ = [
|
||||
'Node',
|
||||
|
|
|
@ -1,14 +1,24 @@
|
|||
import re
|
||||
from collections import Iterable, OrderedDict
|
||||
from collections import Iterable
|
||||
from collections import OrderedDict
|
||||
from functools import partial
|
||||
|
||||
from graphql_relay import connection_from_list
|
||||
from promise import Promise, is_thenable
|
||||
from promise import is_thenable
|
||||
from promise import Promise
|
||||
|
||||
from ..types import (Boolean, Enum, Int, Interface, List, NonNull, Scalar,
|
||||
String, Union)
|
||||
from ..types import Boolean
|
||||
from ..types import Enum
|
||||
from ..types import Int
|
||||
from ..types import Interface
|
||||
from ..types import List
|
||||
from ..types import NonNull
|
||||
from ..types import Scalar
|
||||
from ..types import String
|
||||
from ..types import Union
|
||||
from ..types.field import Field
|
||||
from ..types.objecttype import ObjectType, ObjectTypeOptions
|
||||
from ..types.objecttype import ObjectType
|
||||
from ..types.objecttype import ObjectTypeOptions
|
||||
from .node import is_node
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import re
|
||||
from collections import OrderedDict
|
||||
|
||||
from promise import Promise, is_thenable
|
||||
from promise import is_thenable
|
||||
from promise import Promise
|
||||
|
||||
from ..types import Field, InputObjectType, String
|
||||
from ..types import Field
|
||||
from ..types import InputObjectType
|
||||
from ..types import String
|
||||
from ..types.mutation import Mutation
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,13 @@ from collections import OrderedDict
|
|||
from functools import partial
|
||||
from inspect import isclass
|
||||
|
||||
from graphql_relay import from_global_id, to_global_id
|
||||
from graphql_relay import from_global_id
|
||||
from graphql_relay import to_global_id
|
||||
|
||||
from ..types import ID, Field, Interface, ObjectType
|
||||
from ..types import Field
|
||||
from ..types import ID
|
||||
from ..types import Interface
|
||||
from ..types import ObjectType
|
||||
from ..types.interface import InterfaceOptions
|
||||
from ..types.utils import get_type
|
||||
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
import pytest
|
||||
|
||||
from ...types import Argument, Field, Int, List, NonNull, ObjectType, String, Schema
|
||||
from ..connection import Connection, ConnectionField, PageInfo
|
||||
from ...types import Argument
|
||||
from ...types import Field
|
||||
from ...types import Int
|
||||
from ...types import List
|
||||
from ...types import NonNull
|
||||
from ...types import ObjectType
|
||||
from ...types import Schema
|
||||
from ...types import String
|
||||
from ..connection import Connection
|
||||
from ..connection import ConnectionField
|
||||
from ..connection import PageInfo
|
||||
from ..node import Node
|
||||
|
||||
|
||||
|
|
|
@ -3,8 +3,12 @@ from collections import OrderedDict
|
|||
from graphql_relay.utils import base64
|
||||
from promise import Promise
|
||||
|
||||
from ...types import ObjectType, Schema, String
|
||||
from ..connection import Connection, ConnectionField, PageInfo
|
||||
from ...types import ObjectType
|
||||
from ...types import Schema
|
||||
from ...types import String
|
||||
from ..connection import Connection
|
||||
from ..connection import ConnectionField
|
||||
from ..connection import PageInfo
|
||||
from ..node import Node
|
||||
|
||||
letter_chars = ['A', 'B', 'C', 'D', 'E']
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
from graphql_relay import to_global_id
|
||||
|
||||
from ...types import ID, NonNull, ObjectType, String
|
||||
from ...types import ID
|
||||
from ...types import NonNull
|
||||
from ...types import ObjectType
|
||||
from ...types import String
|
||||
from ...types.definitions import GrapheneObjectType
|
||||
from ..node import GlobalID, Node
|
||||
from ..node import GlobalID
|
||||
from ..node import Node
|
||||
|
||||
|
||||
class CustomNode(Node):
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
import pytest
|
||||
|
||||
from promise import Promise
|
||||
|
||||
from ...types import (ID, Argument, Field, InputField, InputObjectType,
|
||||
NonNull, ObjectType, Schema)
|
||||
from ...types import Argument
|
||||
from ...types import Field
|
||||
from ...types import ID
|
||||
from ...types import InputField
|
||||
from ...types import InputObjectType
|
||||
from ...types import NonNull
|
||||
from ...types import ObjectType
|
||||
from ...types import Schema
|
||||
from ...types.scalars import String
|
||||
from ..mutation import ClientIDMutation
|
||||
|
||||
|
|
|
@ -2,8 +2,11 @@ from collections import OrderedDict
|
|||
|
||||
from graphql_relay import to_global_id
|
||||
|
||||
from ...types import ObjectType, Schema, String
|
||||
from ..node import Node, is_node
|
||||
from ...types import ObjectType
|
||||
from ...types import Schema
|
||||
from ...types import String
|
||||
from ..node import is_node
|
||||
from ..node import Node
|
||||
|
||||
|
||||
class SharedNodeFields(object):
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
from graphql import graphql
|
||||
|
||||
from ...types import Interface, ObjectType, Schema
|
||||
from ...types.scalars import Int, String
|
||||
from ...types import Interface
|
||||
from ...types import ObjectType
|
||||
from ...types import Schema
|
||||
from ...types.scalars import Int
|
||||
from ...types.scalars import String
|
||||
from ..node import Node
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from promise import Promise, is_thenable
|
||||
import six
|
||||
from graphql.error import format_error as format_graphql_error
|
||||
from graphql.error import GraphQLError
|
||||
from promise import is_thenable
|
||||
from promise import Promise
|
||||
|
||||
from graphene.types.schema import Schema
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# https://github.com/graphql-python/graphene/issues/313
|
||||
|
||||
import graphene
|
||||
from graphene import resolve_only_args
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# https://github.com/graphql-python/graphene/issues/356
|
||||
|
||||
import pytest
|
||||
|
||||
import graphene
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# https://github.com/graphql-python/graphene/issues/425
|
||||
# Adapted for Graphene 2.0
|
||||
|
||||
from graphene.types.objecttype import ObjectType, ObjectTypeOptions
|
||||
from graphene.types.inputobjecttype import InputObjectType, InputObjectTypeOptions
|
||||
from graphene.types.enum import Enum, EnumOptions
|
||||
from graphene.types.enum import Enum
|
||||
from graphene.types.enum import EnumOptions
|
||||
from graphene.types.inputobjecttype import InputObjectType
|
||||
from graphene.types.inputobjecttype import InputObjectTypeOptions
|
||||
from graphene.types.objecttype import ObjectType
|
||||
from graphene.types.objecttype import ObjectTypeOptions
|
||||
|
||||
|
||||
# ObjectType
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# https://github.com/graphql-python/graphene/issues/313
|
||||
|
||||
import graphene
|
||||
|
||||
|
||||
|
|
|
@ -1,26 +1,33 @@
|
|||
# flake8: noqa
|
||||
from graphql import ResolveInfo
|
||||
|
||||
from .objecttype import ObjectType
|
||||
from .interface import Interface
|
||||
from .mutation import Mutation
|
||||
from .scalars import Scalar, String, ID, Int, Float, Boolean
|
||||
from .datetime import Date, DateTime, Time
|
||||
from .json import JSONString
|
||||
from .uuid import UUID
|
||||
from .schema import Schema
|
||||
from .structures import List, NonNull
|
||||
from .abstracttype import AbstractType
|
||||
from .argument import Argument
|
||||
from .context import Context
|
||||
from .datetime import Date
|
||||
from .datetime import DateTime
|
||||
from .datetime import Time
|
||||
from .dynamic import Dynamic
|
||||
from .enum import Enum
|
||||
from .field import Field
|
||||
from .inputfield import InputField
|
||||
from .argument import Argument
|
||||
from .inputobjecttype import InputObjectType
|
||||
from .dynamic import Dynamic
|
||||
from .interface import Interface
|
||||
from .json import JSONString
|
||||
from .mutation import Mutation
|
||||
from .objecttype import ObjectType
|
||||
from .scalars import Boolean
|
||||
from .scalars import Float
|
||||
from .scalars import ID
|
||||
from .scalars import Int
|
||||
from .scalars import Scalar
|
||||
from .scalars import String
|
||||
from .schema import Schema
|
||||
from .structures import List
|
||||
from .structures import NonNull
|
||||
from .union import Union
|
||||
from .context import Context
|
||||
|
||||
from .uuid import UUID
|
||||
# Deprecated
|
||||
from .abstracttype import AbstractType
|
||||
|
||||
|
||||
__all__ = [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from ..utils.subclass_with_meta import SubclassWithMeta
|
||||
from ..utils.deprecated import warn_deprecation
|
||||
from ..utils.subclass_with_meta import SubclassWithMeta
|
||||
|
||||
|
||||
class AbstractType(SubclassWithMeta):
|
||||
|
|
|
@ -2,8 +2,10 @@ from __future__ import absolute_import
|
|||
|
||||
import datetime
|
||||
|
||||
from aniso8601 import parse_date
|
||||
from aniso8601 import parse_datetime
|
||||
from aniso8601 import parse_time
|
||||
from graphql.language import ast
|
||||
from aniso8601 import parse_datetime, parse_date, parse_time
|
||||
|
||||
from .scalars import Scalar
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
from graphql import (GraphQLEnumType, GraphQLInputObjectType,
|
||||
GraphQLInterfaceType, GraphQLObjectType,
|
||||
GraphQLScalarType, GraphQLUnionType)
|
||||
from graphql import GraphQLEnumType
|
||||
from graphql import GraphQLInputObjectType
|
||||
from graphql import GraphQLInterfaceType
|
||||
from graphql import GraphQLObjectType
|
||||
from graphql import GraphQLScalarType
|
||||
from graphql import GraphQLUnionType
|
||||
|
||||
|
||||
class GrapheneGraphQLType(object):
|
||||
|
|
|
@ -2,12 +2,11 @@ from collections import OrderedDict
|
|||
|
||||
import six
|
||||
|
||||
from graphene.utils.subclass_with_meta import SubclassWithMeta_Meta
|
||||
|
||||
from .base import BaseOptions, BaseType
|
||||
from .unmountedtype import UnmountedType
|
||||
|
||||
from ..pyutils.compat import Enum as PyEnum
|
||||
from .base import BaseOptions
|
||||
from .base import BaseType
|
||||
from .unmountedtype import UnmountedType
|
||||
from graphene.utils.subclass_with_meta import SubclassWithMeta_Meta
|
||||
|
||||
|
||||
def eq_enum(self, other):
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import inspect
|
||||
from collections import Mapping, OrderedDict
|
||||
from collections import Mapping
|
||||
from collections import OrderedDict
|
||||
from functools import partial
|
||||
|
||||
from .argument import Argument, to_arguments
|
||||
from .argument import Argument
|
||||
from .argument import to_arguments
|
||||
from .mountedtype import MountedType
|
||||
from .structures import NonNull
|
||||
from .unmountedtype import UnmountedType
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from graphene.types.scalars import MAX_INT, MIN_INT
|
||||
from graphql.language.ast import (BooleanValue, FloatValue, IntValue,
|
||||
ListValue, ObjectValue, StringValue)
|
||||
from graphql.language.ast import BooleanValue
|
||||
from graphql.language.ast import FloatValue
|
||||
from graphql.language.ast import IntValue
|
||||
from graphql.language.ast import ListValue
|
||||
from graphql.language.ast import ObjectValue
|
||||
from graphql.language.ast import StringValue
|
||||
|
||||
from .scalars import Scalar
|
||||
from graphene.types.scalars import MAX_INT
|
||||
from graphene.types.scalars import MIN_INT
|
||||
|
||||
|
||||
class GenericScalar(Scalar):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
from .base import BaseOptions, BaseType
|
||||
from .base import BaseOptions
|
||||
from .base import BaseType
|
||||
from .inputfield import InputField
|
||||
from .unmountedtype import UnmountedType
|
||||
from .utils import yank_fields_from_attrs
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
from .base import BaseOptions, BaseType
|
||||
from .base import BaseOptions
|
||||
from .base import BaseType
|
||||
from .field import Field
|
||||
from .utils import yank_fields_from_attrs
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
from ..utils.deprecated import warn_deprecation
|
||||
from ..utils.get_unbound_function import get_unbound_function
|
||||
from ..utils.props import props
|
||||
from .field import Field
|
||||
from .objecttype import ObjectType, ObjectTypeOptions
|
||||
from .objecttype import ObjectType
|
||||
from .objecttype import ObjectTypeOptions
|
||||
from .utils import yank_fields_from_attrs
|
||||
from ..utils.deprecated import warn_deprecation
|
||||
|
||||
|
||||
# For static type checking with Mypy
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
from .base import BaseOptions, BaseType
|
||||
from .base import BaseOptions
|
||||
from .base import BaseType
|
||||
from .field import Field
|
||||
from .interface import Interface
|
||||
from .utils import yank_fields_from_attrs
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import six
|
||||
from graphql.language.ast import BooleanValue
|
||||
from graphql.language.ast import FloatValue
|
||||
from graphql.language.ast import IntValue
|
||||
from graphql.language.ast import StringValue
|
||||
|
||||
from graphql.language.ast import (BooleanValue, FloatValue, IntValue,
|
||||
StringValue)
|
||||
|
||||
from .base import BaseOptions, BaseType
|
||||
from .base import BaseOptions
|
||||
from .base import BaseType
|
||||
from .unmountedtype import UnmountedType
|
||||
|
||||
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
import inspect
|
||||
|
||||
from graphql import GraphQLSchema, graphql, is_type, GraphQLObjectType
|
||||
from graphql.type.directives import (GraphQLDirective, GraphQLIncludeDirective,
|
||||
GraphQLSkipDirective)
|
||||
from graphql import graphql
|
||||
from graphql import GraphQLObjectType
|
||||
from graphql import GraphQLSchema
|
||||
from graphql import is_type
|
||||
from graphql.type.directives import GraphQLDirective
|
||||
from graphql.type.directives import GraphQLIncludeDirective
|
||||
from graphql.type.directives import GraphQLSkipDirective
|
||||
from graphql.type.introspection import IntrospectionSchema
|
||||
from graphql.utils.introspection_query import introspection_query
|
||||
from graphql.utils.schema_printer import print_schema
|
||||
|
||||
from .definitions import GrapheneGraphQLType
|
||||
from .objecttype import ObjectType
|
||||
from .typemap import TypeMap, is_graphene_type
|
||||
from .typemap import is_graphene_type
|
||||
from .typemap import TypeMap
|
||||
|
||||
|
||||
def assert_valid_root_type(_type):
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import pytest
|
||||
|
||||
from .. import abstracttype
|
||||
from ..abstracttype import AbstractType
|
||||
from ..field import Field
|
||||
from ..objecttype import ObjectType
|
||||
from ..unmountedtype import UnmountedType
|
||||
from ..abstracttype import AbstractType
|
||||
from .. import abstracttype
|
||||
from ..field import Field
|
||||
|
||||
|
||||
class MyType(ObjectType):
|
||||
|
|
|
@ -2,7 +2,8 @@ from functools import partial
|
|||
|
||||
import pytest
|
||||
|
||||
from ..argument import Argument, to_arguments
|
||||
from ..argument import Argument
|
||||
from ..argument import to_arguments
|
||||
from ..field import Field
|
||||
from ..inputfield import InputField
|
||||
from ..scalars import String
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import pytest
|
||||
|
||||
from ..base import BaseType, BaseOptions
|
||||
from ..base import BaseOptions
|
||||
from ..base import BaseType
|
||||
|
||||
|
||||
class CustomOptions(BaseOptions):
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import datetime
|
||||
|
||||
import pytz
|
||||
|
||||
from graphql import GraphQLError
|
||||
|
||||
from ..datetime import DateTime, Date, Time
|
||||
from ..datetime import Date
|
||||
from ..datetime import DateTime
|
||||
from ..datetime import Time
|
||||
from ..objecttype import ObjectType
|
||||
from ..schema import Schema
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
from ..argument import Argument
|
||||
from ..enum import Enum
|
||||
from ..field import Field
|
||||
|
@ -7,9 +5,12 @@ from ..inputfield import InputField
|
|||
from ..inputobjecttype import InputObjectType
|
||||
from ..interface import Interface
|
||||
from ..objecttype import ObjectType
|
||||
from ..scalars import Boolean, Int, String
|
||||
from ..scalars import Boolean
|
||||
from ..scalars import Int
|
||||
from ..scalars import String
|
||||
from ..schema import Schema
|
||||
from ..structures import List, NonNull
|
||||
from ..structures import List
|
||||
from ..structures import NonNull
|
||||
from ..union import Union
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from ..dynamic import Dynamic
|
||||
from ..scalars import String
|
||||
from ..structures import List, NonNull
|
||||
from ..structures import List
|
||||
from ..structures import NonNull
|
||||
|
||||
|
||||
def test_dynamic():
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import six
|
||||
|
||||
from ..schema import Schema, ObjectType
|
||||
from ..argument import Argument
|
||||
from ..enum import Enum, PyEnum
|
||||
from ..enum import Enum
|
||||
from ..enum import PyEnum
|
||||
from ..field import Field
|
||||
from ..inputfield import InputField
|
||||
from ..schema import ObjectType
|
||||
from ..schema import Schema
|
||||
|
||||
|
||||
def test_enum_construction():
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
|
||||
from ..argument import Argument
|
||||
from ..field import Field
|
||||
from ..inputfield import InputField
|
||||
from ..inputobjecttype import InputObjectType
|
||||
from ..objecttype import ObjectType
|
||||
from ..unmountedtype import UnmountedType
|
||||
from ..scalars import String, Boolean
|
||||
from ..scalars import Boolean
|
||||
from ..scalars import String
|
||||
from ..schema import Schema
|
||||
from ..unmountedtype import UnmountedType
|
||||
|
||||
|
||||
class MyType(object):
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from ..json import JSONString
|
||||
from ..objecttype import ObjectType
|
||||
from ..schema import Schema
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from ..field import Field
|
||||
from ..scalars import String
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@ import pytest
|
|||
from ..field import Field
|
||||
from ..interface import Interface
|
||||
from ..objecttype import ObjectType
|
||||
from ..unmountedtype import UnmountedType
|
||||
from ..structures import NonNull
|
||||
from ..scalars import String
|
||||
from ..schema import Schema
|
||||
from ..structures import NonNull
|
||||
from ..unmountedtype import UnmountedType
|
||||
|
||||
|
||||
class MyType(Interface):
|
||||
|
|
|
@ -1,19 +1,26 @@
|
|||
import json
|
||||
from functools import partial
|
||||
|
||||
from graphql import GraphQLError, Source, execute, parse, ResolveInfo
|
||||
from graphql import execute
|
||||
from graphql import GraphQLError
|
||||
from graphql import parse
|
||||
from graphql import ResolveInfo
|
||||
from graphql import Source
|
||||
|
||||
from ..context import Context
|
||||
from ..dynamic import Dynamic
|
||||
from ..field import Field
|
||||
from ..inputfield import InputField
|
||||
from ..inputobjecttype import InputObjectType
|
||||
from ..interface import Interface
|
||||
from ..objecttype import ObjectType
|
||||
from ..scalars import Int, String, Boolean
|
||||
from ..scalars import Boolean
|
||||
from ..scalars import Int
|
||||
from ..scalars import String
|
||||
from ..schema import Schema
|
||||
from ..structures import List, NonNull
|
||||
from ..structures import List
|
||||
from ..structures import NonNull
|
||||
from ..union import Union
|
||||
from ..context import Context
|
||||
|
||||
|
||||
def test_query():
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
from ..resolver import (attr_resolver, dict_resolver, get_default_resolver,
|
||||
set_default_resolver)
|
||||
from ..resolver import attr_resolver
|
||||
from ..resolver import dict_resolver
|
||||
from ..resolver import get_default_resolver
|
||||
from ..resolver import set_default_resolver
|
||||
|
||||
args = {}
|
||||
context = None
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from ..scalars import Scalar
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
from ..scalars import Boolean, Float, Int, String
|
||||
from ..scalars import Boolean
|
||||
from ..scalars import Float
|
||||
from ..scalars import Int
|
||||
from ..scalars import String
|
||||
|
||||
|
||||
def test_serializes_output_int():
|
||||
|
|
|
@ -3,7 +3,8 @@ from functools import partial
|
|||
import pytest
|
||||
|
||||
from ..scalars import String
|
||||
from ..structures import List, NonNull
|
||||
from ..structures import List
|
||||
from ..structures import NonNull
|
||||
from .utils import MyLazyType
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
import pytest
|
||||
from graphql.type import GraphQLArgument
|
||||
from graphql.type import GraphQLEnumType
|
||||
from graphql.type import GraphQLEnumValue
|
||||
from graphql.type import GraphQLField
|
||||
from graphql.type import GraphQLInputObjectField
|
||||
from graphql.type import GraphQLInputObjectType
|
||||
from graphql.type import GraphQLInterfaceType
|
||||
from graphql.type import GraphQLObjectType
|
||||
from graphql.type import GraphQLString
|
||||
|
||||
from graphql.type import (GraphQLArgument, GraphQLEnumType, GraphQLEnumValue,
|
||||
GraphQLField, GraphQLInputObjectField,
|
||||
GraphQLInputObjectType, GraphQLInterfaceType,
|
||||
GraphQLObjectType, GraphQLString)
|
||||
|
||||
from ..structures import List, NonNull
|
||||
from ..dynamic import Dynamic
|
||||
from ..enum import Enum
|
||||
from ..field import Field
|
||||
|
@ -13,8 +16,12 @@ from ..inputfield import InputField
|
|||
from ..inputobjecttype import InputObjectType
|
||||
from ..interface import Interface
|
||||
from ..objecttype import ObjectType
|
||||
from ..scalars import String, Int
|
||||
from ..typemap import TypeMap, resolve_type
|
||||
from ..scalars import Int
|
||||
from ..scalars import String
|
||||
from ..structures import List
|
||||
from ..structures import NonNull
|
||||
from ..typemap import resolve_type
|
||||
from ..typemap import TypeMap
|
||||
|
||||
|
||||
def test_enum():
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from ..uuid import UUID
|
||||
from ..objecttype import ObjectType
|
||||
from ..schema import Schema
|
||||
from ..uuid import UUID
|
||||
|
||||
|
||||
class Query(ObjectType):
|
||||
|
|
|
@ -2,19 +2,29 @@ import inspect
|
|||
from collections import OrderedDict
|
||||
from functools import partial
|
||||
|
||||
from graphql import (GraphQLArgument, GraphQLBoolean, GraphQLField,
|
||||
GraphQLFloat, GraphQLID, GraphQLInputObjectField,
|
||||
GraphQLInt, GraphQLList, GraphQLNonNull, GraphQLString)
|
||||
from graphql import GraphQLArgument
|
||||
from graphql import GraphQLBoolean
|
||||
from graphql import GraphQLField
|
||||
from graphql import GraphQLFloat
|
||||
from graphql import GraphQLID
|
||||
from graphql import GraphQLInputObjectField
|
||||
from graphql import GraphQLInt
|
||||
from graphql import GraphQLList
|
||||
from graphql import GraphQLNonNull
|
||||
from graphql import GraphQLString
|
||||
from graphql.execution.executor import get_default_resolve_type_fn
|
||||
from graphql.type import GraphQLEnumValue
|
||||
from graphql.type.typemap import GraphQLTypeMap
|
||||
|
||||
from ..utils.get_unbound_function import get_unbound_function
|
||||
from ..utils.str_converters import to_camel_case
|
||||
from .definitions import (GrapheneEnumType, GrapheneGraphQLType,
|
||||
GrapheneInputObjectType, GrapheneInterfaceType,
|
||||
GrapheneObjectType, GrapheneScalarType,
|
||||
GrapheneUnionType)
|
||||
from .definitions import GrapheneEnumType
|
||||
from .definitions import GrapheneGraphQLType
|
||||
from .definitions import GrapheneInputObjectType
|
||||
from .definitions import GrapheneInterfaceType
|
||||
from .definitions import GrapheneObjectType
|
||||
from .definitions import GrapheneScalarType
|
||||
from .definitions import GrapheneUnionType
|
||||
from .dynamic import Dynamic
|
||||
from .enum import Enum
|
||||
from .field import Field
|
||||
|
@ -22,8 +32,14 @@ from .inputobjecttype import InputObjectType
|
|||
from .interface import Interface
|
||||
from .objecttype import ObjectType
|
||||
from .resolver import get_default_resolver
|
||||
from .scalars import ID, Boolean, Float, Int, Scalar, String
|
||||
from .structures import List, NonNull
|
||||
from .scalars import Boolean
|
||||
from .scalars import Float
|
||||
from .scalars import ID
|
||||
from .scalars import Int
|
||||
from .scalars import Scalar
|
||||
from .scalars import String
|
||||
from .structures import List
|
||||
from .structures import NonNull
|
||||
from .union import Union
|
||||
from .utils import get_field_as
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from .base import BaseOptions, BaseType
|
||||
from .base import BaseOptions
|
||||
from .base import BaseType
|
||||
from .unmountedtype import UnmountedType
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import six
|
||||
from ..pyutils.compat import signature, func_name
|
||||
|
||||
from ..pyutils.compat import func_name
|
||||
from ..pyutils.compat import signature
|
||||
from .deprecated import warn_deprecation
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from functools import wraps
|
||||
|
||||
from .deprecated import deprecated
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import six
|
||||
from inspect import isclass
|
||||
|
||||
import six
|
||||
|
||||
from ..pyutils.init_subclass import InitSubclassMeta
|
||||
from .props import props
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import pytest
|
||||
|
||||
from ..annotate import annotate
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import pytest
|
||||
|
||||
from .. import deprecated
|
||||
from ..deprecated import deprecated as deprecated_decorator, warn_deprecation
|
||||
from ..deprecated import deprecated as deprecated_decorator
|
||||
from ..deprecated import warn_deprecation
|
||||
|
||||
|
||||
def test_warn_deprecation(mocker):
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from pytest import raises
|
||||
|
||||
from graphene import ObjectType, String
|
||||
|
||||
from ..module_loading import import_string, lazy_import
|
||||
from ..module_loading import import_string
|
||||
from ..module_loading import lazy_import
|
||||
from graphene import ObjectType
|
||||
from graphene import String
|
||||
|
||||
|
||||
def test_import_string():
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from ..resolve_only_args import resolve_only_args
|
||||
from .. import deprecated
|
||||
from ..resolve_only_args import resolve_only_args
|
||||
|
||||
|
||||
def test_resolve_only_args(mocker):
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# coding: utf-8
|
||||
from ..str_converters import to_camel_case, to_const, to_snake_case
|
||||
from ..str_converters import to_camel_case
|
||||
from ..str_converters import to_const
|
||||
from ..str_converters import to_snake_case
|
||||
|
||||
|
||||
def test_snake_case():
|
||||
|
|
8
setup.py
8
setup.py
|
@ -1,8 +1,10 @@
|
|||
from setuptools import find_packages, setup
|
||||
from setuptools.command.test import test as TestCommand
|
||||
import sys
|
||||
import ast
|
||||
import re
|
||||
import sys
|
||||
|
||||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
from setuptools.command.test import test as TestCommand
|
||||
|
||||
_version_re = re.compile(r'VERSION\s+=\s+(.*)')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user