Replies: 1 comment
-
It appears that this isn't supported today, although I would be supportive of adding this functionality. Probably the simplest way to achieve this with today's APIs is to add an implementation method on the // resolver.go
func (r *Resolver) Children(node model.Node) ([]*model.Node, error) {
// common implementation goes here
}
// schema.resolvers.go
// Children is the resolver for the children field.
func (r *elem1Resolver) Children(ctx context.Context, obj *model.Exercise) ([]*model.Employee, error) {
return r.Resolver.Children(obj)
}
// Children is the resolver for the children field.
func (r *elem2Resolver) Children(ctx context.Context, obj *model.Flying) ([]*model.Employee, error) {
return r.Resolver.Children(obj)
}
// Children is the resolver for the children field.
func (r *elem3Resolver) Children(ctx context.Context, obj *model.Gaming) ([]*model.Employee, error) {
return r.Resolver.Children(obj)
}
// Children is the resolver for the children field.
func (r *elem4Resolver) Children(ctx context.Context, obj *model.Other) ([]*model.Employee, error) {
return r.Resolver.Children(obj)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, is it possible to use forceResolver on an interface and not a type ?
With the following code I don't have any resolvers generated:
My goal is to implement the parent/children resolvers only once since the logic is the same for all the Node types.
If not possible what would be the best way to achieve that?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions