Args: query (string) - GraphQL query to run operation_name (string) - If the query is a mutation or named query, you must supply the operation_name. For annon queries ("{ ... }"), should be None (de
(
self, query, operation_name=None, input_data=None, variables=None, headers=None
)
| 81 | GRAPHQL_URL = graphene_settings.TESTING_ENDPOINT |
| 82 | |
| 83 | def query( |
| 84 | self, query, operation_name=None, input_data=None, variables=None, headers=None |
| 85 | ): |
| 86 | """ |
| 87 | Args: |
| 88 | query (string) - GraphQL query to run |
| 89 | operation_name (string) - If the query is a mutation or named query, you must |
| 90 | supply the operation_name. For annon queries ("{ ... }"), |
| 91 | should be None (default). |
| 92 | input_data (dict) - If provided, the $input variable in GraphQL will be set |
| 93 | to this value. If both ``input_data`` and ``variables``, |
| 94 | are provided, the ``input`` field in the ``variables`` |
| 95 | dict will be overwritten with this value. |
| 96 | variables (dict) - If provided, the "variables" field in GraphQL will be |
| 97 | set to this value. |
| 98 | headers (dict) - If provided, the headers in POST request to GRAPHQL_URL |
| 99 | will be set to this value. Keys should be prepended with |
| 100 | "HTTP_" (e.g. to specify the "Authorization" HTTP header, |
| 101 | use "HTTP_AUTHORIZATION" as the key). |
| 102 | |
| 103 | Returns: |
| 104 | Response object from client |
| 105 | """ |
| 106 | return graphql_query( |
| 107 | query, |
| 108 | operation_name=operation_name, |
| 109 | input_data=input_data, |
| 110 | variables=variables, |
| 111 | headers=headers, |
| 112 | client=self.client, |
| 113 | graphql_url=self.GRAPHQL_URL, |
| 114 | ) |
| 115 | |
| 116 | @property |
| 117 | def _client(self): |
no test coverage detected