diff --git a/codegen/object.go b/codegen/object.go index 70429a21ca7..7b9e3d6f597 100644 --- a/codegen/object.go +++ b/codegen/object.go @@ -84,8 +84,8 @@ type Objects []*Object func (o *Object) Implementors() string { satisfiedBy := strconv.Quote(o.Name) - for _, s := range o.Definition.Interfaces { - satisfiedBy += ", " + strconv.Quote(s) + for _, s := range o.Implements { + satisfiedBy += ", " + strconv.Quote(s.Name) } return "[]string{" + satisfiedBy + "}" } diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 8351189ad9c..a58e8e26b41 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -3657,7 +3657,7 @@ func (ec *executionContext) _ShapeUnion(ctx context.Context, sel ast.SelectionSe // region **************************** object.gotpl **************************** -var circleImplementors = []string{"Circle", "Shape"} +var circleImplementors = []string{"Circle", "Shape", "ShapeUnion"} func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, obj *Circle) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, circleImplementors) @@ -4097,7 +4097,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -var rectangleImplementors = []string{"Rectangle", "Shape"} +var rectangleImplementors = []string{"Rectangle", "Shape", "ShapeUnion"} func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet, obj *Rectangle) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, rectangleImplementors) diff --git a/example/starwars/generated.go b/example/starwars/generated.go index eadab3d5563..e69ac3f814b 100644 --- a/example/starwars/generated.go +++ b/example/starwars/generated.go @@ -2897,7 +2897,7 @@ func (ec *executionContext) _SearchResult(ctx context.Context, sel ast.Selection // region **************************** object.gotpl **************************** -var droidImplementors = []string{"Droid", "Character"} +var droidImplementors = []string{"Droid", "Character", "SearchResult"} func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, obj *Droid) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, droidImplementors) @@ -3024,7 +3024,7 @@ func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionS return out } -var humanImplementors = []string{"Human", "Character"} +var humanImplementors = []string{"Human", "Character", "SearchResult"} func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, obj *Human) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, humanImplementors) @@ -3263,7 +3263,7 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o return out } -var starshipImplementors = []string{"Starship"} +var starshipImplementors = []string{"Starship", "SearchResult"} func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, obj *Starship) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, starshipImplementors) diff --git a/example/type-system-extension/generated.go b/example/type-system-extension/generated.go index 79575cf6e9b..190b4c6ba87 100644 --- a/example/type-system-extension/generated.go +++ b/example/type-system-extension/generated.go @@ -1613,7 +1613,7 @@ func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) return out } -var todoImplementors = []string{"Todo", "Node"} +var todoImplementors = []string{"Todo", "Node", "Data"} func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *Todo) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, todoImplementors)