Fix duplicated ErrorType declaration

This commit is contained in:
Patrick Arminio 2018-10-18 14:07:07 -07:00
parent 94486e0df1
commit 0fbdfba994
No known key found for this signature in database
GPG Key ID: 6F384394A3714144
4 changed files with 8 additions and 7 deletions

View File

@ -14,7 +14,7 @@ from graphene.types.utils import yank_fields_from_attrs
from graphene_django.registry import get_global_registry
from .converter import convert_form_field
from .types import ErrorType
from ..types import ErrorType
def fields_for_form(form, only_fields, exclude_fields):

View File

@ -9,7 +9,7 @@ from graphene.relay.mutation import ClientIDMutation
from graphene.types.objecttype import yank_fields_from_attrs
from .serializer_converter import convert_serializer_field
from .types import ErrorType
from ..types import ErrorType
class SerializerMutationOptions(MutationOptions):

View File

@ -2,11 +2,6 @@ import graphene
from graphene.types.unmountedtype import UnmountedType
class ErrorType(graphene.ObjectType):
field = graphene.String(required=True)
messages = graphene.List(graphene.NonNull(graphene.String), required=True)
class DictType(UnmountedType):
key = graphene.String()
value = graphene.String()

View File

@ -1,6 +1,7 @@
from collections import OrderedDict
from django.utils.functional import SimpleLazyObject
import graphene
from graphene import Field
from graphene.relay import Connection, Node
from graphene.types.objecttype import ObjectType, ObjectTypeOptions
@ -133,3 +134,8 @@ class DjangoObjectType(ObjectType):
return cls._meta.model.objects.get(pk=id)
except cls._meta.model.DoesNotExist:
return None
class ErrorType(ObjectType):
field = graphene.String(required=True)
messages = graphene.List(graphene.NonNull(graphene.String), required=True)