gql

package
v0.0.0-...-3638110 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 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.

Types

type AccountResolver

type AccountResolver interface {
	Labels(ctx context.Context, obj *model.Account) ([]*model.KeyAndValue, error)
	Children(ctx context.Context, obj *model.Account) ([]*model.Account, error)
	Parent(ctx context.Context, obj *model.Account) (*model.Account, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	Account struct {
		Children    func(childComplexity int) int
		DisplayName func(childComplexity int) int
		ID          func(childComplexity int) int
		Labels      func(childComplexity int) int
		Parent      func(childComplexity int) int
	}

	KeyAndValue struct {
		Key   func(childComplexity int) int
		Value func(childComplexity int) int
	}

	Mutation struct {
		CreateAccount              func(childComplexity int, input model.NewAccount) int
		CreateTransaction          func(childComplexity int, input model.NewTransaction) int
		CreateTransactions         func(childComplexity int, inputs []*model.NewTransaction) int
		DeleteAccount              func(childComplexity int, id string) int
		UpdateAccount              func(childComplexity int, id string, input model.AccountUpdate) int
		UploadTransactionsXLSFile  func(childComplexity int, file graphql.Upload) int
		UploadTransactionsXLSXFile func(childComplexity int, file graphql.Upload) int
	}

	Query struct {
		Account func(childComplexity int, id string) int
		Roots   func(childComplexity int) int
	}

	Tenant struct {
		DisplayName func(childComplexity int) int
		ID          func(childComplexity int) int
		Slug        func(childComplexity int) int
	}

	Transaction struct {
		Amount        func(childComplexity int) int
		Date          func(childComplexity int) int
		Description   func(childComplexity int) int
		ID            func(childComplexity int) int
		ReferenceID   func(childComplexity int) int
		SourceAccount func(childComplexity int) int
		TargetAccount func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	CreateAccount(ctx context.Context, input model.NewAccount) (*model.Account, error)
	UpdateAccount(ctx context.Context, id string, input model.AccountUpdate) (*model.Account, error)
	DeleteAccount(ctx context.Context, id string) (string, error)
	CreateTransaction(ctx context.Context, input model.NewTransaction) (*model.Transaction, error)
	CreateTransactions(ctx context.Context, inputs []*model.NewTransaction) (int, error)
	UploadTransactionsXLSFile(ctx context.Context, file graphql.Upload) (bool, error)
	UploadTransactionsXLSXFile(ctx context.Context, file graphql.Upload) (bool, error)
}

type QueryResolver

type QueryResolver interface {
	Roots(ctx context.Context) ([]*model.Account, error)
	Account(ctx context.Context, id string) (*model.Account, error)
}

type ResolverRoot

type ResolverRoot interface {
	Account() AccountResolver
	Mutation() MutationResolver
	Query() QueryResolver
}

Jump to

Keyboard shortcuts

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