Skip to content

Commit e65582d

Browse files
author
Jannis Pohlmann
committed
ast: Use the op name to filter operation definitions
1 parent 16c4398 commit e65582d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ast.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ func operationDefinitionsWithOperation(
1212
for _, node := range doc.Definitions {
1313
if node.GetKind() == "OperationDefinition" {
1414
if def, ok := node.(*ast.OperationDefinition); ok {
15-
defs = append(defs, def)
15+
if def.Name.Value == op {
16+
defs = append(defs, def)
17+
}
1618
}
1719
}
1820
}

0 commit comments

Comments
 (0)