@@ -159,19 +159,20 @@ impl HTTPSubgraphExecutor {
159159impl SubgraphExecutor for HTTPSubgraphExecutor {
160160 async fn execute < ' a > (
161161 & self ,
162- execution_request : HttpExecutionRequest < ' a > ,
162+ execution_request : & ' a HttpExecutionRequest < ' a > ,
163163 ) -> HttpExecutionResponse {
164- let body = match self . build_request_body ( & execution_request) {
164+ let body = match self . build_request_body ( execution_request) {
165165 Ok ( body) => body,
166166 Err ( e) => {
167167 return HttpExecutionResponse {
168168 body : error_to_graphql_bytes ( & self . endpoint , e) ,
169169 headers : Default :: default ( ) ,
170+ status : http:: StatusCode :: BAD_REQUEST ,
170171 }
171172 }
172173 } ;
173174
174- let mut headers = execution_request. headers ;
175+ let mut headers = execution_request. headers . clone ( ) ;
175176 self . header_map . iter ( ) . for_each ( |( key, value) | {
176177 headers. insert ( key, value. clone ( ) ) ;
177178 } ) ;
@@ -184,10 +185,12 @@ impl SubgraphExecutor for HTTPSubgraphExecutor {
184185 Ok ( shared_response) => HttpExecutionResponse {
185186 body : shared_response. body ,
186187 headers : shared_response. headers ,
188+ status : shared_response. status ,
187189 } ,
188190 Err ( e) => HttpExecutionResponse {
189191 body : error_to_graphql_bytes ( & self . endpoint , e) ,
190192 headers : Default :: default ( ) ,
193+ status : http:: StatusCode :: BAD_REQUEST ,
191194 } ,
192195 } ;
193196 }
@@ -223,10 +226,12 @@ impl SubgraphExecutor for HTTPSubgraphExecutor {
223226 Ok ( shared_response) => HttpExecutionResponse {
224227 body : shared_response. body . clone ( ) ,
225228 headers : shared_response. headers . clone ( ) ,
229+ status : shared_response. status ,
226230 } ,
227231 Err ( e) => HttpExecutionResponse {
228232 body : error_to_graphql_bytes ( & self . endpoint , e. clone ( ) ) ,
229233 headers : Default :: default ( ) ,
234+ status : http:: StatusCode :: BAD_REQUEST ,
230235 } ,
231236 }
232237 }
0 commit comments