From e510b64ef6ad7299b41e80b98abc28cc1bfca15a Mon Sep 17 00:00:00 2001 From: bannzai Date: Wed, 12 Jan 2022 13:58:24 +0900 Subject: [PATCH] Fix pick implements --- core.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core.go b/core.go index de9daa3..abc99aa 100644 --- a/core.go +++ b/core.go @@ -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{} @@ -57,6 +61,7 @@ func run(pass *gqlanalysis.Pass) (interface{}, error) { ok = true } } + if !ok { needToNodeTypes = append(needToNodeTypes, v) }