Skip to content

Commit 4abdbe8

Browse files
committed
fix: ensure variables passed to subgraph requests
1 parent 7f11828 commit 4abdbe8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/executor/src/execution/plan.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,12 @@ impl<'exec> Executor<'exec> {
522522
node: &FetchNode,
523523
representations: Option<Vec<u8>>,
524524
) -> Result<ExecutionJob, PlanExecutionError> {
525+
let variable_refs = self.variable_values.as_ref().map(|vars| {
526+
vars.iter()
527+
.map(|(key, value)| (key.as_str(), value))
528+
.collect::<HashMap<&str, &sonic_rs::Value>>()
529+
});
530+
525531
Ok(ExecutionJob::Fetch(FetchJob {
526532
fetch_node_id: node.id,
527533
response: self
@@ -532,7 +538,7 @@ impl<'exec> Executor<'exec> {
532538
query: node.operation.document_str.as_str(),
533539
dedupe: self.dedupe_subgraph_requests,
534540
operation_name: node.operation_name.as_deref(),
535-
variables: None,
541+
variables: variable_refs,
536542
representations,
537543
},
538544
)

0 commit comments

Comments
 (0)