Skip to content

Instantly share code, notes, and snippets.

@bickyeric
Last active July 16, 2019 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bickyeric/ef55c7350ae7603f334a8a4b90c24b5d to your computer and use it in GitHub Desktop.
Save bickyeric/ef55c7350ae7603f334a8a4b90c24b5d to your computer and use it in GitHub Desktop.
// query_resolver.go
package graph
import "context"
type queryResolver struct {
ComicByID *FindByID
ComicAll *SearchAll
}
func (r *queryResolver) Comic(ctx context.Context, id string) (*Comic, error) {
return r.ComicByID.Perform(ctx, id)
}
func (r *queryResolver) AllComics(
ctx context.Context,
skip *int,
limit *int) ([]*Comic, error) {
return r.ComicAll.Perform(ctx, skip, limit)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment