Skip to content

Commit 77b8467

Browse files
author
blokhinnv
committed
added option to return raw graphql response
1 parent c86206a commit 77b8467

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

leetcode/api/default_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def graphql_post(self, **kwargs): # noqa: E501
159159
(data) = self.graphql_post_with_http_info(**kwargs) # noqa: E501
160160
return data
161161

162-
def graphql_post_with_http_info(self, **kwargs): # noqa: E501
162+
def graphql_post_with_http_info(self, response_type: str | None = "GraphqlResponse", **kwargs): # noqa: E501
163163
"""graphql_post # noqa: E501
164164
165165
This method makes a synchronous HTTP request by default. To make an
@@ -233,7 +233,7 @@ def graphql_post_with_http_info(self, **kwargs): # noqa: E501
233233
body=body_params,
234234
post_params=form_params,
235235
files=local_var_files,
236-
response_type="GraphqlResponse", # noqa: E501
236+
response_type=response_type, # noqa: E501
237237
auth_settings=auth_settings,
238238
async_req=params.get("async_req"),
239239
_return_http_data_only=params.get("_return_http_data_only"),

leetcode/api_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ def deserialize(self, response, response_type):
246246
except ValueError:
247247
data = response.data
248248

249+
if response_type == "json":
250+
return data
251+
249252
return self.__deserialize(data, response_type)
250253

251254
def __deserialize(self, data, klass):

0 commit comments

Comments
 (0)