Documentation
¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type MutationResolver
- type MyMutation
- type MyMutationResolver
- type MyQuery
- type MyQueryResolver
- type Number
- type Ownable
- type QueryResolver
- type ResolverRoot
- type Role
- type Todo
- type TodoInput
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var AllRole = []Role{ RoleAdmin, RoleOwner, }
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct {
MyMutation struct {
CreateTodo func(childComplexity int, todo TodoInput) int
UpdateTodo func(childComplexity int, id int, changes map[string]any) int
}
MyQuery struct {
LastTodo func(childComplexity int) int
Todo func(childComplexity int, id int) int
Todos func(childComplexity int) int
}
Todo struct {
Done func(childComplexity int) int
ID func(childComplexity int) int
Text func(childComplexity int) int
}
}
type Config ¶
type Config = graphql.Config[ResolverRoot, DirectiveRoot, ComplexityRoot]
type DirectiveRoot ¶
type MutationResolver ¶
type MutationResolver resolvers
func (*MutationResolver) CreateTodo ¶
func (*MutationResolver) UpdateTodo ¶
type MyMutation ¶
type MyMutation struct {
}
type MyMutationResolver ¶
type MyQueryResolver ¶
type QueryResolver ¶
type QueryResolver resolvers
func (*QueryResolver) LastTodo ¶
func (r *QueryResolver) LastTodo(ctx context.Context) (*Todo, error)
type ResolverRoot ¶
type ResolverRoot interface {
MyMutation() MyMutationResolver
MyQuery() MyQueryResolver
}
type Role ¶
type Role string
func (Role) MarshalGQL ¶
func (Role) MarshalJSON ¶
func (*Role) UnmarshalGQL ¶
func (*Role) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.