gql

package
v0.0.0-...-ec25b82 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 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)
	ChildCount(ctx context.Context, obj *model.Account) (int, error)
	Children(ctx context.Context, obj *model.Account) ([]*model.Account, error)
	Parent(ctx context.Context, obj *model.Account) (*model.Account, error)
	OutgoingTransactions(ctx context.Context, obj *model.Account) ([]*model.Transaction, error)
	IncomingTransactions(ctx context.Context, obj *model.Account) ([]*model.Transaction, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	Account struct {
		ChildCount           func(childComplexity int) int
		Children             func(childComplexity int) int
		DisplayName          func(childComplexity int) int
		ID                   func(childComplexity int) int
		Icon                 func(childComplexity int) int
		IncomingTransactions func(childComplexity int) int
		Labels               func(childComplexity int) int
		OutgoingTransactions func(childComplexity int) int
		Parent               func(childComplexity int) int
		Tenant               func(childComplexity int) int
	}

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

	Mutation struct {
		CreateAccount         func(childComplexity int, tenantID string, accountID *string, account model.AccountChanges) int
		CreateTenant          func(childComplexity int, tenantID *string, tenant model.TenantChanges) int
		CreateTransaction     func(childComplexity int, tenantID string, transaction model.TransactionChanges) int
		CreateTransactions    func(childComplexity int, tenantID string, transactions []*model.TransactionChanges) int
		DeleteAccount         func(childComplexity int, tenantID string, accountID string) int
		DeleteTenant          func(childComplexity int, tenantID string) int
		ScrapeIsraelBankYahav func(childComplexity int, tenantID string, username string, id string, password string) int
		UpdateAccount         func(childComplexity int, tenantID string, accountID string, account model.AccountChanges) int
		UpdateOperation       func(childComplexity int, id string, op model.OperationChanges) int
		UpdateTenant          func(childComplexity int, tenantID string, tenant model.TenantChanges) int
	}

	Operation struct {
		CreatedAt   func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
		Result      func(childComplexity int) int
		Status      func(childComplexity int) int
		UpdatedAt   func(childComplexity int) int
	}

	Query struct {
		Operation func(childComplexity int, id string) int
		Tenant    func(childComplexity int, id string) int
		Tenants   func(childComplexity int) int
	}

	Tenant struct {
		Account      func(childComplexity int, id string) int
		Accounts     func(childComplexity int) int
		DisplayName  func(childComplexity int) int
		ID           func(childComplexity int) int
		Transactions 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 {
	CreateTenant(ctx context.Context, tenantID *string, tenant model.TenantChanges) (*model.Tenant, error)
	UpdateTenant(ctx context.Context, tenantID string, tenant model.TenantChanges) (*model.Tenant, error)
	DeleteTenant(ctx context.Context, tenantID string) (string, error)
	CreateAccount(ctx context.Context, tenantID string, accountID *string, account model.AccountChanges) (*model.Account, error)
	UpdateAccount(ctx context.Context, tenantID string, accountID string, account model.AccountChanges) (*model.Account, error)
	DeleteAccount(ctx context.Context, tenantID string, accountID string) (string, error)
	CreateTransaction(ctx context.Context, tenantID string, transaction model.TransactionChanges) (*model.Transaction, error)
	CreateTransactions(ctx context.Context, tenantID string, transactions []*model.TransactionChanges) (int, error)
	ScrapeIsraelBankYahav(ctx context.Context, tenantID string, username string, id string, password string) (string, error)
	UpdateOperation(ctx context.Context, id string, op model.OperationChanges) (*model.Operation, error)
}

type QueryResolver

type QueryResolver interface {
	Tenants(ctx context.Context) ([]*model.Tenant, error)
	Tenant(ctx context.Context, id string) (*model.Tenant, error)
	Operation(ctx context.Context, id string) (*model.Operation, error)
}

type ResolverRoot

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

type TenantResolver

type TenantResolver interface {
	Accounts(ctx context.Context, obj *model.Tenant) ([]*model.Account, error)
	Account(ctx context.Context, obj *model.Tenant, id string) (*model.Account, error)
	Transactions(ctx context.Context, obj *model.Tenant) ([]*model.Transaction, error)
}

Jump to

Keyboard shortcuts

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