From 7bf22a32dec00a786ee5c539bf174c48c1a2636b Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Sun, 19 Apr 2020 21:16:37 +0100 Subject: [PATCH] Rename op_name to operation_name --- graphene_django/utils/testing.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/graphene_django/utils/testing.py b/graphene_django/utils/testing.py index 8a9b994..6365d81 100644 --- a/graphene_django/utils/testing.py +++ b/graphene_django/utils/testing.py @@ -24,11 +24,13 @@ class GraphQLTestCase(TestCase): cls._client = Client() - def query(self, query, op_name=None, input_data=None, variables=None, headers=None): + def query( + self, query, operation_name=None, input_data=None, variables=None, headers=None + ): """ Args: query (string) - GraphQL query to run - op_name (string) - If the query is a mutation or named query, you must + operation_name (string) - If the query is a mutation or named query, you must supply the op_name. For annon queries ("{ ... }"), should be None (default). input_data (dict) - If provided, the $input variable in GraphQL will be set @@ -44,8 +46,8 @@ class GraphQLTestCase(TestCase): Response object from client """ body = {"query": query} - if op_name: - body["operation_name"] = op_name + if operation_name: + body["operationName"] = operation_name if variables: body["variables"] = variables if input_data: