Skip to content

Commit

Permalink
Merge pull request #106 from marwan-at-work/multidirs
Browse files Browse the repository at this point in the history
Add ForNames method to DirectiveList
  • Loading branch information
vektah authored Aug 7, 2019
2 parents 7ceb135 + 76f43a2 commit 96ed341
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ast/collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 96ed341

Please sign in to comment.