Skip to content

Commit

Permalink
Fix pick implements
Browse files Browse the repository at this point in the history
  • Loading branch information
bannzai committed Jan 12, 2022
1 parent c62532e commit e510b64
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ func run(pass *gqlanalysis.Pass) (interface{}, error) {
}

allNodeImplements := map[string]*ast.Definition{}
for _, t := range pass.Schema.Implements["Node"] {
allNodeImplements[t.Name] = t
for name, t := range allTypes {
for _, typeInterface := range pass.Schema.Implements[name] {
if typeInterface.Kind == ast.Interface && typeInterface.Name == "Node" {
allNodeImplements[name] = t
}
}
}

unconformedTypes := map[string]*ast.Definition{}
Expand All @@ -57,6 +61,7 @@ func run(pass *gqlanalysis.Pass) (interface{}, error) {
ok = true
}
}

if !ok {
needToNodeTypes = append(needToNodeTypes, v)
}
Expand Down

0 comments on commit e510b64

Please sign in to comment.