graph

package
v0.0.0-...-8e0a72f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

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.

func NewSchema

func NewSchema(client *ent.Client, logger *zap.Logger, config *config.ServerConfig) graphql.ExecutableSchema

func UserFromContext

func UserFromContext(ctx context.Context) (*ent.User, bool)

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(client *ent.Client) *Auth

func (*Auth) Init

func (m *Auth) Init() func(http.Handler) http.Handler

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 EntityResolver interface {
	FindUserByID(ctx context.Context, id string) (*ent.User, error)
}

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL