diff --git a/ast/collections.go b/ast/collections.go index 6bf67297..94b800ee 100644 --- a/ast/collections.go +++ b/ast/collections.go @@ -33,6 +33,16 @@ func (l DirectiveList) ForName(name string) *Directive { return nil } +func (l DirectiveList) ForNames(name string) []*Directive { + resp := []*Directive{} + for _, it := range l { + if it.Name == name { + resp = append(resp, it) + } + } + return resp +} + type OperationList []*OperationDefinition func (l OperationList) ForName(name string) *OperationDefinition {