diff --git a/compiler/crates/graphql-syntax/src/node/executable.rs b/compiler/crates/graphql-syntax/src/node/executable.rs index c87203955930f..1ca3881511933 100644 --- a/compiler/crates/graphql-syntax/src/node/executable.rs +++ b/compiler/crates/graphql-syntax/src/node/executable.rs @@ -59,6 +59,13 @@ impl ExecutableDefinition { .any(|d| d.name.value == directive_name), } } + + pub fn selections(&self) -> &[Selection] { + match self { + ExecutableDefinition::Operation(node) => &node.selections.items, + ExecutableDefinition::Fragment(node) => &node.selections.items, + } + } } impl fmt::Debug for ExecutableDefinition {