Documentation ¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func NewSchema(client *ent.Client, logger *zap.Logger, config *config.ServerConfig) graphql.ExecutableSchema
- func UserFromContext(ctx context.Context) (*ent.User, bool)
- type Auth
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type EntityResolver
- type MutationResolver
- type QueryResolver
- type Resolver
- type ResolverRoot
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.
func NewSchema ¶
func NewSchema(client *ent.Client, logger *zap.Logger, config *config.ServerConfig) graphql.ExecutableSchema
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Entity struct { FindUserByID func(childComplexity int, id string) int } Mutation struct { CreateUser func(childComplexity int, input ent.CreateUserInput) int RequestLoginCode func(childComplexity int, input model.RequestLoginCode) int UpdateUser func(childComplexity int, id string, input ent.UpdateUserInput) int ValidateLoginCode func(childComplexity int, input model.ValidateLoginCode) int } PageInfo struct { EndCursor func(childComplexity int) int HasNextPage func(childComplexity int) int HasPreviousPage func(childComplexity int) int StartCursor func(childComplexity int) int } Query struct { Node func(childComplexity int, id string) int Nodes func(childComplexity int, ids []string) int Users func(childComplexity int, after *ent.Cursor, first *int, before *ent.Cursor, last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) int // contains filtered or unexported fields } User struct { CreatedAt func(childComplexity int) int Email func(childComplexity int) int FirstRun func(childComplexity int) int ID func(childComplexity int) int UpdatedAt func(childComplexity int) int } UserConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } UserEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } // contains filtered or unexported fields }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type EntityResolver ¶
type MutationResolver ¶
type MutationResolver interface { CreateUser(ctx context.Context, input ent.CreateUserInput) (*ent.User, error) UpdateUser(ctx context.Context, id string, input ent.UpdateUserInput) (*ent.User, error) RequestLoginCode(ctx context.Context, input model.RequestLoginCode) (string, error) ValidateLoginCode(ctx context.Context, input model.ValidateLoginCode) (string, error) }
type QueryResolver ¶
type QueryResolver interface { Node(ctx context.Context, id string) (ent.Noder, error) Nodes(ctx context.Context, ids []string) ([]ent.Noder, error) Users(ctx context.Context, after *ent.Cursor, first *int, before *ent.Cursor, last *int, orderBy *ent.UserOrder, where *ent.UserWhereInput) (*ent.UserConnection, error) }
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) Entity ¶
func (r *Resolver) Entity() EntityResolver
Entity returns EntityResolver implementation.
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation returns MutationResolver implementation.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns QueryResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { Entity() EntityResolver Mutation() MutationResolver Query() QueryResolver }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.