graphql

package
v0.0.0-...-35d49a2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func NewHandler

func NewHandler(db *gnucash.Database) http.Handler

NewHandler returns a new graphql endpoint handler.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Account struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
		Type func(childComplexity int) int
	}

	Query struct {
		Account     func(childComplexity int, id string) int
		Accounts    func(childComplexity int, name string) int
		RootAccount func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type QueryResolver

type QueryResolver interface {
	RootAccount(ctx context.Context) (*gnucash.Account, error)
	Account(ctx context.Context, id string) (*gnucash.Account, error)
	Accounts(ctx context.Context, name string) ([]*gnucash.Account, error)
}

type Resolver

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

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	Query() QueryResolver
}

Jump to

Keyboard shortcuts

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