Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownType = errors.New("unknown type") ErrTypeNotFound = errors.New("type not found") )
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct {
Entity struct {
FindUserByID func(childComplexity int, id string) int
}
Mutation struct {
ChangePassword func(childComplexity int, oldPassword string, newPassword string) int
Disable func(childComplexity int, userID string) int
Enable func(childComplexity int, userID string) int
Grant func(childComplexity int, userID string, permissions []string) int
Revoke func(childComplexity int, userID string, permissions []string) int
SignIn func(childComplexity int, login string, password string) int
SignOut func(childComplexity int) int
SignUp func(childComplexity int, name string, login string, password string) int
}
Query struct {
CurrentUser func(childComplexity int) int
Users func(childComplexity int) int
// contains filtered or unexported fields
}
Token struct {
Token func(childComplexity int) int
}
User struct {
Enabled func(childComplexity int) int
ID func(childComplexity int) int
Login func(childComplexity int) int
Name func(childComplexity int) int
Permissions func(childComplexity int) int
}
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
Schema *ast.Schema
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type DirectiveRoot ¶
type DirectiveRoot struct {
}
type EntityRepresentation ¶
EntityRepresentation is the JSON representation of an entity sent by the Router used as the inputs for us to resolve.
We make it a map because we know the top level JSON is always an object.
type EntityResolver ¶
type EntityWithIndex ¶
type EntityWithIndex struct {
// contains filtered or unexported fields
}
type MutationResolver ¶
type MutationResolver interface {
SignIn(ctx context.Context, login string, password string) (*Token, error)
SignUp(ctx context.Context, name string, login string, password string) (*Token, error)
SignOut(ctx context.Context) (bool, error)
ChangePassword(ctx context.Context, oldPassword string, newPassword string) (bool, error)
Enable(ctx context.Context, userID string) (bool, error)
Disable(ctx context.Context, userID string) (bool, error)
Grant(ctx context.Context, userID string, permissions []string) (bool, error)
Revoke(ctx context.Context, userID string, permissions []string) (bool, error)
}
type QueryResolver ¶
type ResolverRoot ¶
type ResolverRoot interface {
Entity() EntityResolver
Mutation() MutationResolver
Query() QueryResolver
}
Click to show internal directories.
Click to hide internal directories.