Skip to content

Commit ae35584

Browse files
committed
graph: Validate if pruning is decalred for source subgraph
1 parent 6a80868 commit ae35584

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

graph/src/data/subgraph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ pub struct BaseSubgraphManifest<C, S, D, T> {
583583
#[derive(Debug, Deserialize)]
584584
#[serde(rename_all = "camelCase")]
585585
pub struct IndexerHints {
586-
prune: Option<Prune>,
586+
pub prune: Option<Prune>,
587587
}
588588

589589
impl IndexerHints {

graph/src/data_source/subgraph.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,17 @@ impl UnresolvedDataSource {
294294
));
295295
}
296296

297+
let pruning_enabled = match source_manifest.indexer_hints.as_ref() {
298+
None => false,
299+
Some(hints) => hints.prune.is_some(),
300+
};
301+
302+
if pruning_enabled {
303+
return Err(anyhow!(
304+
"Pruning is enabled for source subgraph, which is not supported"
305+
));
306+
}
307+
297308
let mapping_entities: Vec<String> = self
298309
.mapping
299310
.handlers

0 commit comments

Comments
 (0)