Skip to content

Instantly share code, notes, and snippets.

@vniche
Created March 7, 2020 18:18
Show Gist options
  • Save vniche/2a8ce4fd81210216b5dd56da09570afc to your computer and use it in GitHub Desktop.
Save vniche/2a8ce4fd81210216b5dd56da09570afc to your computer and use it in GitHub Desktop.
Handling not implemented as a GraphQL error in gqlgen
// THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES.
package graph
import (
"context"
"fmt"
)
type Resolver struct{}
func (r *mutationResolver) Signup(ctx context.Context, input NewUser) (string, error) {
return "", fmt.Errorf("not implemented")
}
func (r *queryResolver) User(ctx context.Context, id string) (*User, error) {
return nil, fmt.Errorf("not implemented")
}
func (r *queryResolver) Users(ctx context.Context) ([]*User, error) {
var results []*User
return results, fmt.Errorf("not implemented")
}
func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} }
func (r *Resolver) Query() QueryResolver { return &queryResolver{r} }
type mutationResolver struct{ *Resolver }
type queryResolver struct{ *Resolver }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment