mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-29 21:13:58 +03:00
Rewrite imports to be relative instead of absolute
This commit is contained in:
parent
f4a8d53409
commit
5282627537
|
@ -1,9 +1,8 @@
|
|||
from django.db import models
|
||||
from singledispatch import singledispatch
|
||||
|
||||
from graphene.contrib.django.fields import (ConnectionOrListField,
|
||||
DjangoModelField)
|
||||
from graphene.core.types.scalars import ID, Boolean, Float, Int, String
|
||||
from ...core.types.scalars import ID, Boolean, Float, Int, String
|
||||
from .fields import ConnectionOrListField, DjangoModelField
|
||||
|
||||
try:
|
||||
UUIDField = models.UUIDField
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
from graphene import relay
|
||||
from graphene.contrib.django.utils import get_type_for_model, lazy_map
|
||||
from graphene.core.exceptions import SkipField
|
||||
from graphene.core.fields import Field
|
||||
from graphene.core.types.base import FieldType
|
||||
from graphene.core.types.definitions import List
|
||||
from graphene.relay.utils import is_node
|
||||
from ...core.exceptions import SkipField
|
||||
from ...core.fields import Field
|
||||
from ...core.types.base import FieldType
|
||||
from ...core.types.definitions import List
|
||||
from ...relay import ConnectionField
|
||||
from ...relay.utils import is_node
|
||||
from .utils import get_type_for_model, lazy_map
|
||||
|
||||
|
||||
class DjangoConnectionField(relay.ConnectionField):
|
||||
class DjangoConnectionField(ConnectionField):
|
||||
|
||||
def wrap_resolved(self, value, instance, args, info):
|
||||
schema = info.schema.graphene_schema
|
||||
|
|
|
@ -2,9 +2,9 @@ import inspect
|
|||
|
||||
from django.db import models
|
||||
|
||||
from graphene.core.options import Options
|
||||
from graphene.relay.types import Node
|
||||
from graphene.relay.utils import is_node
|
||||
from ...core.options import Options
|
||||
from ...relay.types import Node
|
||||
from ...relay.utils import is_node
|
||||
|
||||
VALID_ATTRS = ('model', 'only_fields', 'exclude_fields')
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import six
|
||||
|
||||
from graphene.contrib.django.converter import convert_django_field
|
||||
from graphene.contrib.django.options import DjangoOptions
|
||||
from graphene.contrib.django.utils import get_reverse_fields
|
||||
from graphene.core.types import BaseObjectType, ObjectTypeMeta
|
||||
from graphene.relay.fields import GlobalIDField
|
||||
from graphene.relay.types import BaseNode
|
||||
from ...core.types import BaseObjectType, ObjectTypeMeta
|
||||
from ...relay.fields import GlobalIDField
|
||||
from ...relay.types import BaseNode
|
||||
from .converter import convert_django_field
|
||||
from .options import DjangoOptions
|
||||
from .utils import get_reverse_fields
|
||||
|
||||
|
||||
class DjangoObjectTypeMeta(ObjectTypeMeta):
|
||||
|
|
|
@ -2,7 +2,7 @@ from django.db import models
|
|||
from django.db.models.manager import Manager
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
from graphene.utils import LazyMap
|
||||
from ...utils import LazyMap
|
||||
|
||||
|
||||
def get_type_for_model(schema, model):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from collections import OrderedDict
|
||||
|
||||
from graphene.utils import cached_property
|
||||
from ..utils import cached_property
|
||||
|
||||
DEFAULT_NAMES = ('description', 'name', 'is_interface', 'is_mutation',
|
||||
'type_name', 'interfaces')
|
||||
|
|
|
@ -2,14 +2,15 @@ import inspect
|
|||
from collections import OrderedDict
|
||||
|
||||
from graphene import signals
|
||||
from graphene.core.types.base import BaseType
|
||||
from graphene.core.types.objecttype import BaseObjectType
|
||||
from graphql.core.execution.executor import Executor
|
||||
from graphql.core.execution.middlewares.sync import \
|
||||
SynchronousExecutionMiddleware
|
||||
from graphql.core.type import GraphQLSchema as _GraphQLSchema
|
||||
from graphql.core.utils.introspection_query import introspection_query
|
||||
|
||||
from .types.base import BaseType
|
||||
from .types.objecttype import BaseObjectType
|
||||
|
||||
|
||||
class GraphQLSchema(_GraphQLSchema):
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from itertools import chain
|
|||
|
||||
from graphql.core.type import GraphQLArgument
|
||||
|
||||
from ...utils import to_camel_case, ProxySnakeDict
|
||||
from ...utils import ProxySnakeDict, to_camel_case
|
||||
from .base import ArgumentType, BaseType, OrderedType
|
||||
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@ from functools import partial
|
|||
import six
|
||||
|
||||
from graphene import signals
|
||||
from graphene.core.exceptions import SkipField
|
||||
from graphene.core.options import Options
|
||||
from graphene.core.types.argument import ArgumentsGroup
|
||||
from graphene.core.types.base import BaseType
|
||||
from graphene.core.types.definitions import List, NonNull
|
||||
from graphql.core.type import (GraphQLArgument, GraphQLInputObjectType,
|
||||
GraphQLInterfaceType, GraphQLObjectType)
|
||||
|
||||
from ..exceptions import SkipField
|
||||
from ..options import Options
|
||||
from .argument import ArgumentsGroup
|
||||
from .base import BaseType
|
||||
from .definitions import List, NonNull
|
||||
|
||||
|
||||
class ObjectTypeMeta(type):
|
||||
options_cls = Options
|
||||
|
@ -210,6 +211,7 @@ class ObjectType(six.with_metaclass(ObjectTypeMeta, BaseObjectType)):
|
|||
|
||||
|
||||
class Mutation(six.with_metaclass(ObjectTypeMeta, BaseObjectType)):
|
||||
|
||||
@classmethod
|
||||
def _construct_arguments(cls, items):
|
||||
return ArgumentsGroup(**items)
|
||||
|
|
|
@ -4,7 +4,7 @@ from graphene.core.schema import Schema
|
|||
from graphene.core.types import ObjectType
|
||||
from graphql.core.type import GraphQLArgument
|
||||
|
||||
from ..argument import Argument, to_arguments, snake_case_args
|
||||
from ..argument import Argument, snake_case_args, to_arguments
|
||||
from ..scalars import String
|
||||
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ from graphene.core.types import InputObjectType, ObjectType
|
|||
|
||||
from ..argument import Argument
|
||||
from ..base import MountedType, OrderedType
|
||||
from ..field import Field, InputField
|
||||
from ..definitions import List, NonNull
|
||||
from ..field import Field, InputField
|
||||
|
||||
|
||||
def test_orderedtype_equal():
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from graphene.relay.fields import (
|
||||
from .fields import (
|
||||
ConnectionField,
|
||||
NodeField,
|
||||
GlobalIDField,
|
||||
)
|
||||
|
||||
from graphene.relay.types import (
|
||||
from .types import (
|
||||
Node,
|
||||
PageInfo,
|
||||
Edge,
|
||||
|
@ -12,7 +12,7 @@ from graphene.relay.types import (
|
|||
ClientIDMutation
|
||||
)
|
||||
|
||||
from graphene.relay.utils import is_node
|
||||
from .utils import is_node
|
||||
|
||||
__all__ = ['ConnectionField', 'NodeField', 'GlobalIDField', 'Node',
|
||||
'PageInfo', 'Edge', 'Connection', 'ClientIDMutation', 'is_node']
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
from collections import Iterable
|
||||
|
||||
from graphene.core.fields import Field
|
||||
from graphene.core.types.definitions import NonNull
|
||||
from graphene.core.types.scalars import ID, Int, String
|
||||
from graphql_relay.connection.arrayconnection import connection_from_list
|
||||
from graphql_relay.node.node import from_global_id
|
||||
|
||||
from ..core.fields import Field
|
||||
from ..core.types.definitions import NonNull
|
||||
from ..core.types.scalars import ID, Int, String
|
||||
|
||||
|
||||
class ConnectionField(Field):
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
from graphene.core.types import (Boolean, Field, InputObjectType, Interface,
|
||||
List, Mutation, ObjectType, String)
|
||||
from graphene.core.types.argument import ArgumentsGroup
|
||||
from graphene.core.types.base import LazyType
|
||||
from graphene.core.types.definitions import NonNull
|
||||
from graphene.relay.fields import GlobalIDField
|
||||
from graphene.utils import memoize
|
||||
from graphql_relay.node.node import to_global_id
|
||||
|
||||
from ..core.types import (Boolean, Field, InputObjectType, Interface, List,
|
||||
Mutation, ObjectType, String)
|
||||
from ..core.types.argument import ArgumentsGroup
|
||||
from ..core.types.base import LazyType
|
||||
from ..core.types.definitions import NonNull
|
||||
from ..utils import memoize
|
||||
from .fields import GlobalIDField
|
||||
|
||||
|
||||
class PageInfo(ObjectType):
|
||||
has_next_page = Boolean(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from graphene.relay.types import BaseNode
|
||||
from .types import BaseNode
|
||||
|
||||
|
||||
def is_node(object_type):
|
||||
|
|
Loading…
Reference in New Issue
Block a user