mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-22 13:59:51 +03:00
isort observer in root dir
This commit is contained in:
parent
cc764ebc7b
commit
207ea631ad
|
@ -3,7 +3,7 @@ droid_data = {}
|
|||
|
||||
|
||||
def setup():
|
||||
from .schema import Human, Droid
|
||||
from .schema import Droid, Human
|
||||
|
||||
global human_data, droid_data
|
||||
luke = Human(
|
||||
|
|
|
@ -4,7 +4,7 @@ data = {}
|
|||
def setup():
|
||||
global data
|
||||
|
||||
from .schema import Ship, Faction
|
||||
from .schema import Faction, Ship
|
||||
|
||||
xwing = Ship(id="1", name="X-Wing")
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import unicode_literals
|
|||
|
||||
from snapshottest import Snapshot
|
||||
|
||||
|
||||
snapshots = Snapshot()
|
||||
|
||||
snapshots["test_correctly_fetches_id_name_rebels 1"] = {
|
||||
|
|
|
@ -1,43 +1,11 @@
|
|||
from .pyutils.version import get_version
|
||||
from .relay import (
|
||||
ClientIDMutation,
|
||||
Connection,
|
||||
ConnectionField,
|
||||
GlobalID,
|
||||
Node,
|
||||
PageInfo,
|
||||
is_node,
|
||||
)
|
||||
from .types import (
|
||||
ID,
|
||||
UUID,
|
||||
Argument,
|
||||
Base64,
|
||||
Boolean,
|
||||
Context,
|
||||
Date,
|
||||
DateTime,
|
||||
Decimal,
|
||||
Dynamic,
|
||||
Enum,
|
||||
Field,
|
||||
Float,
|
||||
InputField,
|
||||
InputObjectType,
|
||||
Int,
|
||||
Interface,
|
||||
JSONString,
|
||||
List,
|
||||
Mutation,
|
||||
NonNull,
|
||||
ObjectType,
|
||||
ResolveInfo,
|
||||
Scalar,
|
||||
Schema,
|
||||
String,
|
||||
Time,
|
||||
Union,
|
||||
)
|
||||
from .relay import (ClientIDMutation, Connection, ConnectionField, GlobalID,
|
||||
Node, PageInfo, is_node)
|
||||
from .types import (ID, UUID, Argument, Base64, Boolean, Context, Date,
|
||||
DateTime, Decimal, Dynamic, Enum, Field, Float, InputField,
|
||||
InputObjectType, Int, Interface, JSONString, List,
|
||||
Mutation, NonNull, ObjectType, ResolveInfo, Scalar, Schema,
|
||||
String, Time, Union)
|
||||
from .utils.module_loading import lazy_import
|
||||
from .utils.resolve_only_args import resolve_only_args
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
# https://docs.python.org/3/library/dataclasses.html
|
||||
# Original PEP proposal: PEP 557
|
||||
# https://www.python.org/dev/peps/pep-0557/
|
||||
import re
|
||||
import sys
|
||||
import copy
|
||||
import types
|
||||
import inspect
|
||||
import keyword
|
||||
import re
|
||||
import sys
|
||||
import types
|
||||
|
||||
__all__ = [
|
||||
"dataclass",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from promise import Promise, is_thenable
|
||||
from graphql.error import format_error as format_graphql_error
|
||||
from graphql.error import GraphQLError
|
||||
from graphql.error import format_error as format_graphql_error
|
||||
from promise import Promise, is_thenable
|
||||
|
||||
from graphene.types.schema import Schema
|
||||
|
||||
|
|
|
@ -71,9 +71,9 @@ class Argument(MountedType):
|
|||
|
||||
|
||||
def to_arguments(args, extra_args=None):
|
||||
from .unmountedtype import UnmountedType
|
||||
from .field import Field
|
||||
from .inputfield import InputField
|
||||
from .unmountedtype import UnmountedType
|
||||
|
||||
if extra_args:
|
||||
extra_args = sorted(extra_args.items(), key=lambda f: f[1])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from binascii import Error as _Error
|
||||
from base64 import b64decode, b64encode
|
||||
from binascii import Error as _Error
|
||||
|
||||
from graphql.error import GraphQLError
|
||||
from graphql.language import StringValueNode, print_ast
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
from enum import Enum as PyEnum
|
||||
|
||||
from graphql import (
|
||||
GraphQLEnumType,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLObjectType,
|
||||
GraphQLScalarType,
|
||||
GraphQLUnionType,
|
||||
Undefined,
|
||||
)
|
||||
from graphql import (GraphQLEnumType, GraphQLInputObjectType,
|
||||
GraphQLInterfaceType, GraphQLObjectType,
|
||||
GraphQLScalarType, GraphQLUnionType, Undefined)
|
||||
|
||||
|
||||
class GrapheneGraphQLType:
|
||||
|
|
|
@ -2,13 +2,13 @@ import inspect
|
|||
from collections.abc import Mapping
|
||||
from functools import partial
|
||||
|
||||
from ..utils.deprecated import warn_deprecation
|
||||
from .argument import Argument, to_arguments
|
||||
from .mountedtype import MountedType
|
||||
from .resolver import default_resolver
|
||||
from .structures import NonNull
|
||||
from .unmountedtype import UnmountedType
|
||||
from .utils import get_type
|
||||
from ..utils.deprecated import warn_deprecation
|
||||
|
||||
base_type = type
|
||||
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from graphql.language.ast import (
|
||||
BooleanValueNode,
|
||||
FloatValueNode,
|
||||
IntValueNode,
|
||||
ListValueNode,
|
||||
ObjectValueNode,
|
||||
StringValueNode,
|
||||
)
|
||||
from graphql.language.ast import (BooleanValueNode, FloatValueNode,
|
||||
IntValueNode, ListValueNode, ObjectValueNode,
|
||||
StringValueNode)
|
||||
|
||||
from graphene.types.scalars import MAX_INT, MIN_INT
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from .utils import yank_fields_from_attrs
|
|||
# For static type checking with Mypy
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from typing import Dict, Callable # NOQA
|
||||
from typing import Callable, Dict # NOQA
|
||||
|
||||
|
||||
class InputObjectTypeOptions(BaseOptions):
|
||||
|
|
|
@ -2,15 +2,16 @@ 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 .interface import Interface
|
||||
from .objecttype import ObjectType, ObjectTypeOptions
|
||||
from .utils import yank_fields_from_attrs
|
||||
from .interface import Interface
|
||||
|
||||
# For static type checking with Mypy
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from typing import Callable, Dict, Iterable, Type # NOQA
|
||||
|
||||
from .argument import Argument # NOQA
|
||||
from typing import Dict, Type, Callable, Iterable # NOQA
|
||||
|
||||
|
||||
class MutationOptions(ObjectTypeOptions):
|
||||
|
|
|
@ -4,9 +4,9 @@ from .interface import Interface
|
|||
from .utils import yank_fields_from_attrs
|
||||
|
||||
try:
|
||||
from dataclasses import make_dataclass, field
|
||||
from dataclasses import field, make_dataclass
|
||||
except ImportError:
|
||||
from ..pyutils.dataclasses import make_dataclass, field # type: ignore
|
||||
from ..pyutils.dataclasses import field, make_dataclass # type: ignore
|
||||
|
||||
# For static type checking with Mypy
|
||||
MYPY = False
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
from typing import Any
|
||||
|
||||
from graphql.language.ast import (
|
||||
BooleanValueNode,
|
||||
FloatValueNode,
|
||||
IntValueNode,
|
||||
StringValueNode,
|
||||
)
|
||||
from graphql.language.ast import (BooleanValueNode, FloatValueNode,
|
||||
IntValueNode, StringValueNode)
|
||||
|
||||
from .base import BaseOptions, BaseType
|
||||
from .unmountedtype import UnmountedType
|
||||
|
|
|
@ -1,45 +1,21 @@
|
|||
import inspect
|
||||
from functools import partial
|
||||
|
||||
from graphql import (
|
||||
default_type_resolver,
|
||||
get_introspection_query,
|
||||
graphql,
|
||||
graphql_sync,
|
||||
introspection_types,
|
||||
parse,
|
||||
print_schema,
|
||||
subscribe,
|
||||
validate,
|
||||
ExecutionResult,
|
||||
GraphQLArgument,
|
||||
GraphQLBoolean,
|
||||
GraphQLError,
|
||||
GraphQLEnumValue,
|
||||
GraphQLField,
|
||||
GraphQLFloat,
|
||||
GraphQLID,
|
||||
GraphQLInputField,
|
||||
GraphQLInt,
|
||||
GraphQLList,
|
||||
GraphQLNonNull,
|
||||
GraphQLObjectType,
|
||||
GraphQLSchema,
|
||||
GraphQLString,
|
||||
Undefined,
|
||||
)
|
||||
from graphql import (ExecutionResult, GraphQLArgument, GraphQLBoolean,
|
||||
GraphQLEnumValue, GraphQLError, GraphQLField,
|
||||
GraphQLFloat, GraphQLID, GraphQLInputField, GraphQLInt,
|
||||
GraphQLList, GraphQLNonNull, GraphQLObjectType,
|
||||
GraphQLSchema, GraphQLString, Undefined,
|
||||
default_type_resolver, get_introspection_query, graphql,
|
||||
graphql_sync, introspection_types, parse, print_schema,
|
||||
subscribe, validate)
|
||||
|
||||
from ..utils.str_converters import to_camel_case
|
||||
from ..utils.get_unbound_function import get_unbound_function
|
||||
from .definitions import (
|
||||
GrapheneEnumType,
|
||||
GrapheneGraphQLType,
|
||||
GrapheneInputObjectType,
|
||||
GrapheneInterfaceType,
|
||||
GrapheneObjectType,
|
||||
GrapheneScalarType,
|
||||
GrapheneUnionType,
|
||||
)
|
||||
from ..utils.str_converters import to_camel_case
|
||||
from .definitions import (GrapheneEnumType, GrapheneGraphQLType,
|
||||
GrapheneInputObjectType, GrapheneInterfaceType,
|
||||
GrapheneObjectType, GrapheneScalarType,
|
||||
GrapheneUnionType)
|
||||
from .dynamic import Dynamic
|
||||
from .enum import Enum
|
||||
from .field import Field
|
||||
|
|
|
@ -2,10 +2,10 @@ import base64
|
|||
|
||||
from graphql import GraphQLError
|
||||
|
||||
from ..base64 import Base64
|
||||
from ..objecttype import ObjectType
|
||||
from ..scalars import String
|
||||
from ..schema import Schema
|
||||
from ..base64 import Base64
|
||||
|
||||
|
||||
class Query(ObjectType):
|
||||
|
|
|
@ -2,7 +2,6 @@ import datetime
|
|||
|
||||
import pytz
|
||||
from graphql import GraphQLError
|
||||
|
||||
from pytest import fixture
|
||||
|
||||
from ..datetime import Date, DateTime, Time
|
||||
|
|
|
@ -2,12 +2,12 @@ from pytest import raises
|
|||
|
||||
from ..argument import Argument
|
||||
from ..dynamic import Dynamic
|
||||
from ..interface import Interface
|
||||
from ..mutation import Mutation
|
||||
from ..objecttype import ObjectType
|
||||
from ..scalars import String
|
||||
from ..schema import Schema
|
||||
from ..structures import NonNull
|
||||
from ..interface import Interface
|
||||
|
||||
|
||||
class MyType(Interface):
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
import json
|
||||
from functools import partial
|
||||
|
||||
from graphql import (
|
||||
GraphQLError,
|
||||
GraphQLResolveInfo as ResolveInfo,
|
||||
Source,
|
||||
execute,
|
||||
parse,
|
||||
)
|
||||
from graphql import GraphQLError
|
||||
from graphql import GraphQLResolveInfo as ResolveInfo
|
||||
from graphql import Source, execute, parse
|
||||
|
||||
from ..context import Context
|
||||
from ..dynamic import Dynamic
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
from ..resolver import (
|
||||
attr_resolver,
|
||||
dict_resolver,
|
||||
dict_or_attr_resolver,
|
||||
get_default_resolver,
|
||||
set_default_resolver,
|
||||
)
|
||||
from ..resolver import (attr_resolver, dict_or_attr_resolver, dict_resolver,
|
||||
get_default_resolver, set_default_resolver)
|
||||
|
||||
args = {}
|
||||
context = None
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from ..scalars import Scalar, Int, BigInt
|
||||
from graphql.language.ast import IntValueNode
|
||||
|
||||
from ..scalars import BigInt, Int, Scalar
|
||||
|
||||
|
||||
def test_scalar():
|
||||
class JSONScalar(Scalar):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from pytest import mark
|
||||
|
||||
from graphene import ObjectType, Int, String, Schema, Field
|
||||
from graphene import Field, Int, ObjectType, Schema, String
|
||||
|
||||
|
||||
class Query(ObjectType):
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
from graphql.type import (
|
||||
GraphQLArgument,
|
||||
GraphQLEnumType,
|
||||
GraphQLEnumValue,
|
||||
GraphQLField,
|
||||
GraphQLInputField,
|
||||
GraphQLInputObjectType,
|
||||
GraphQLInterfaceType,
|
||||
GraphQLObjectType,
|
||||
GraphQLString,
|
||||
)
|
||||
from graphql.type import (GraphQLArgument, GraphQLEnumType, GraphQLEnumValue,
|
||||
GraphQLField, GraphQLInputField,
|
||||
GraphQLInputObjectType, GraphQLInterfaceType,
|
||||
GraphQLObjectType, GraphQLString)
|
||||
|
||||
from ..dynamic import Dynamic
|
||||
from ..enum import Enum
|
||||
|
@ -18,8 +11,8 @@ from ..inputobjecttype import InputObjectType
|
|||
from ..interface import Interface
|
||||
from ..objecttype import ObjectType
|
||||
from ..scalars import Int, String
|
||||
from ..structures import List, NonNull
|
||||
from ..schema import Schema
|
||||
from ..structures import List, NonNull
|
||||
|
||||
|
||||
def create_type_map(types, auto_camelcase=True):
|
||||
|
|
|
@ -4,9 +4,10 @@ from .unmountedtype import UnmountedType
|
|||
# For static type checking with Mypy
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from .objecttype import ObjectType # NOQA
|
||||
from typing import Iterable, Type # NOQA
|
||||
|
||||
from .objecttype import ObjectType # NOQA
|
||||
|
||||
|
||||
class UnionOptions(BaseOptions):
|
||||
types = () # type: Iterable[Type[ObjectType]]
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from uuid import UUID as _UUID
|
||||
|
||||
from graphql.language.ast import StringValueNode
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import datetime
|
||||
|
||||
import graphene
|
||||
from graphene import relay
|
||||
from graphene.types.resolver import dict_resolver
|
||||
|
|
Loading…
Reference in New Issue
Block a user