1- use std:: {
2- borrow:: Cow ,
3- collections:: { BTreeSet , HashMap } ,
4- } ;
1+ use std:: collections:: { BTreeSet , HashMap } ;
52
63use bytes:: { BufMut , Bytes } ;
74use futures:: { future:: BoxFuture , stream:: FuturesUnordered , StreamExt } ;
@@ -51,26 +48,26 @@ use crate::{
5148 } ,
5249} ;
5350
54- pub struct OperationDetails < ' a > {
55- pub name : Option < String > ,
56- pub query : Cow < ' a , str > ,
57- pub kind : & ' a str ,
51+ pub struct OperationDetails < ' exec > {
52+ pub name : Option < & ' exec str > ,
53+ pub query : & ' exec str ,
54+ pub kind : & ' static str ,
5855}
5956
60- pub struct ClientRequestDetails < ' a > {
61- pub method : Method ,
62- pub url : http:: Uri ,
63- pub headers : & ' a NtexHeaderMap ,
64- pub operation : OperationDetails < ' a > ,
57+ pub struct ClientRequestDetails < ' exec , ' req > {
58+ pub method : & ' req Method ,
59+ pub url : & ' req http:: Uri ,
60+ pub headers : & ' req NtexHeaderMap ,
61+ pub operation : OperationDetails < ' exec > ,
6562}
6663
67- pub struct QueryPlanExecutionContext < ' exec > {
64+ pub struct QueryPlanExecutionContext < ' exec , ' req > {
6865 pub query_plan : & ' exec QueryPlan ,
6966 pub projection_plan : & ' exec Vec < FieldProjectionPlan > ,
7067 pub headers_plan : & ' exec HeaderRulesPlan ,
7168 pub variable_values : & ' exec Option < HashMap < String , sonic_rs:: Value > > ,
7269 pub extensions : Option < HashMap < String , sonic_rs:: Value > > ,
73- pub client_request : ClientRequestDetails < ' exec > ,
70+ pub client_request : & ' exec ClientRequestDetails < ' exec , ' req > ,
7471 pub introspection_context : & ' exec IntrospectionContext < ' exec , ' static > ,
7572 pub operation_type_name : & ' exec str ,
7673 pub executors : & ' exec SubgraphExecutorMap ,
@@ -82,8 +79,8 @@ pub struct PlanExecutionOutput {
8279 pub headers : HeaderMap ,
8380}
8481
85- pub async fn execute_query_plan < ' exec > (
86- ctx : QueryPlanExecutionContext < ' exec > ,
82+ pub async fn execute_query_plan < ' exec , ' req > (
83+ ctx : QueryPlanExecutionContext < ' exec , ' req > ,
8784) -> Result < PlanExecutionOutput , PlanExecutionError > {
8885 let init_value = if let Some ( introspection_query) = ctx. introspection_context . query {
8986 resolve_introspection ( introspection_query, ctx. introspection_context )
@@ -96,7 +93,7 @@ pub async fn execute_query_plan<'exec>(
9693 ctx. variable_values ,
9794 ctx. executors ,
9895 ctx. introspection_context . metadata ,
99- & ctx. client_request ,
96+ ctx. client_request ,
10097 ctx. headers_plan ,
10198 ctx. jwt_auth_forwarding ,
10299 // Deduplicate subgraph requests only if the operation type is a query
@@ -137,11 +134,11 @@ pub async fn execute_query_plan<'exec>(
137134 } )
138135}
139136
140- pub struct Executor < ' exec > {
137+ pub struct Executor < ' exec , ' req > {
141138 variable_values : & ' exec Option < HashMap < String , sonic_rs:: Value > > ,
142139 schema_metadata : & ' exec SchemaMetadata ,
143140 executors : & ' exec SubgraphExecutorMap ,
144- client_request : & ' exec ClientRequestDetails < ' exec > ,
141+ client_request : & ' exec ClientRequestDetails < ' exec , ' req > ,
145142 headers_plan : & ' exec HeaderRulesPlan ,
146143 jwt_forwarding_plan : & ' exec Option < JwtAuthForwardingPlan > ,
147144 dedupe_subgraph_requests : bool ,
@@ -231,12 +228,12 @@ struct PreparedFlattenData {
231228 representation_hash_to_index : HashMap < u64 , usize > ,
232229}
233230
234- impl < ' exec > Executor < ' exec > {
231+ impl < ' exec , ' req > Executor < ' exec , ' req > {
235232 pub fn new (
236233 variable_values : & ' exec Option < HashMap < String , sonic_rs:: Value > > ,
237234 executors : & ' exec SubgraphExecutorMap ,
238235 schema_metadata : & ' exec SchemaMetadata ,
239- client_request : & ' exec ClientRequestDetails < ' exec > ,
236+ client_request : & ' exec ClientRequestDetails < ' exec , ' req > ,
240237 headers_plan : & ' exec HeaderRulesPlan ,
241238 jwt_forwarding_plan : & ' exec Option < JwtAuthForwardingPlan > ,
242239 dedupe_subgraph_requests : bool ,
0 commit comments