File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ impl GithubClient {
143143 Ok ( e) => {
144144 return Err ( anyhow:: Error :: new ( * e) ) . with_context ( || {
145145 format ! (
146- "req={req_url} (x-github-request-id: {}): lenght exceeded (over {max_response_size} bytes)" ,
146+ "req={req_url} (x-github-request-id: {}): max response size exceeded (over {max_response_size} bytes)" ,
147147 github_request_id
148148 . as_ref( )
149149 . and_then( |v| v. to_str( ) . ok( ) )
@@ -333,11 +333,21 @@ impl GithubClient {
333333 query : & str ,
334334 vars : serde_json:: Value ,
335335 ) -> anyhow:: Result < serde_json:: Value > {
336- self . json ( self . post ( & self . graphql_url ) . json ( & serde_json:: json!( {
337- "query" : query,
338- "variables" : vars,
339- } ) ) )
340- . await
336+ // Our GraphQl query can end-up being quite big, let's set a higher default
337+ // response size than for normal REST Api response.
338+ const MAX_DEFAULT_GRAPH_QL_RESPONSE_SIZE : usize = 6 * 1024 * 1024 ;
339+
340+ let ( body, _dbg) = self
341+ . send_req_with_limit (
342+ self . post ( & self . graphql_url ) . json ( & serde_json:: json!( {
343+ "query" : query,
344+ "variables" : vars,
345+ } ) ) ,
346+ MAX_DEFAULT_GRAPH_QL_RESPONSE_SIZE ,
347+ )
348+ . await ?;
349+
350+ Ok ( serde_json:: from_slice ( & body) ?)
341351 }
342352
343353 /// Issues an ad-hoc GraphQL query.
You can’t perform that action at this time.
0 commit comments