graph

package
v0.0.0-...-599a714 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Begin(context.Context) (db.Tx, error)
	NoTxn(context.Context) db.Tx
	Transactional(context.Context, func(tx db.Tx) error) error
	RunOrContinueTransaction(db.Tx, func(tx db.Tx) error) error

	User(db.Tx, todo.UserID) (*todo.User, error)
	Users(db.Tx) ([]*todo.User, error)
	CreateUser(db.Tx, authn.Provider, authn.UserID, string, string) (todo.UserID, error)
	UpdateUser(db.Tx, todo.UserID, ...db.UpdateUserFn) error

	Task(db.Tx, todo.TaskID) (*todo.Task, error)
	TasksByCreator(db.Tx, todo.UserID) ([]*todo.Task, error)
	CreateTask(db.Tx, todo.UserID) (todo.TaskID, error)
	UpdateTask(db.Tx, todo.TaskID, ...db.UpdateTaskFn) error
	DeleteTask(db.Tx, todo.TaskID) error
}

type Resolver

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

func NewResolver

func NewResolver(cfg *ResolverConfig) (*Resolver, error)

NewResolver returns an initialized Resolver that can handle GraphQL queries.

func (*Resolver) Mutation

func (r *Resolver) Mutation() generated.MutationResolver

These are part of the gqlgen interface, see https://gqlgen.com/

func (*Resolver) Query

func (r *Resolver) Query() generated.QueryResolver

type ResolverConfig

type ResolverConfig struct {
	DB     DB
	Logger *zap.Logger
}

Directories

Path Synopsis
Package graphconv handles translation between our API/wire layer (i.e.
Package graphconv handles translation between our API/wire layer (i.e.
Package graphutil provides helpers for working with GraphQL/gqlgen.
Package graphutil provides helpers for working with GraphQL/gqlgen.

Jump to

Keyboard shortcuts

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