mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 17:46:57 +03:00
Fix handling of root value to be like Schema.execute
.
This commit is contained in:
parent
49a7b15a47
commit
77a588a5b1
|
@ -2,9 +2,15 @@ from graphql_django_view import GraphQLView as BaseGraphQLView
|
|||
|
||||
|
||||
class GraphQLView(BaseGraphQLView):
|
||||
graphene_schema = None
|
||||
|
||||
def __init__(self, schema, **kwargs):
|
||||
super(GraphQLView, self).__init__(
|
||||
graphene_schema=schema,
|
||||
schema=schema.schema,
|
||||
executor=schema.executor,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
def get_root_value(self, request):
|
||||
return self.graphene_schema.query(super(GraphQLView, self).get_root_value(request))
|
||||
|
|
|
@ -23,8 +23,7 @@ class Human(DjangoNode):
|
|||
class Meta:
|
||||
model = Article
|
||||
|
||||
@staticmethod
|
||||
def resolve_raises(*args):
|
||||
def resolve_raises(self, *args):
|
||||
raise Exception("This field should raise exception")
|
||||
|
||||
def get_node(self, id):
|
||||
|
|
Loading…
Reference in New Issue
Block a user