From aeb04d5b5cc914a6906ae17a52714edf483811e8 Mon Sep 17 00:00:00 2001 From: Sergey Fursov Date: Sun, 23 Feb 2020 12:50:40 +0300 Subject: [PATCH] use actual root/variables/context args of the execute method (#878) --- graphene_django/filter/tests/test_fields.py | 2 +- graphene_django/forms/tests/test_mutation.py | 2 +- graphene_django/views.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/graphene_django/filter/tests/test_fields.py b/graphene_django/filter/tests/test_fields.py index de366ba..a0f7d96 100644 --- a/graphene_django/filter/tests/test_fields.py +++ b/graphene_django/filter/tests/test_fields.py @@ -180,7 +180,7 @@ def test_filter_shortcut_filterset_context(): } """ schema = Schema(query=Query) - result = schema.execute(query, context=context()) + result = schema.execute(query, context_value=context()) assert not result.errors assert len(result.data["contextArticles"]["edges"]) == 1 diff --git a/graphene_django/forms/tests/test_mutation.py b/graphene_django/forms/tests/test_mutation.py index cafec90..f648330 100644 --- a/graphene_django/forms/tests/test_mutation.py +++ b/graphene_django/forms/tests/test_mutation.py @@ -229,7 +229,7 @@ class ModelFormMutationTests(TestCase): } } """, - variables={"pk": pet.pk}, + variable_values={"pk": pet.pk}, ) self.assertIs(result.errors, None) diff --git a/graphene_django/views.py b/graphene_django/views.py index d2c8324..4c58839 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -274,10 +274,10 @@ class GraphQLView(View): extra_options["executor"] = self.executor return document.execute( - root=self.get_root_value(request), - variables=variables, + root_value=self.get_root_value(request), + variable_values=variables, operation_name=operation_name, - context=self.get_context(request), + context_value=self.get_context(request), middleware=self.get_middleware(request), **extra_options )