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.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Comment struct { ID func(childComplexity int) int } Entity struct { FindInvoiceByID func(childComplexity int, id string) int FindUserByID func(childComplexity int, id string) int } Expense struct { Amount func(childComplexity int) int Code func(childComplexity int) int Created func(childComplexity int) int Currency func(childComplexity int) int Date func(childComplexity int) int Description func(childComplexity int) int ID func(childComplexity int) int Metadata func(childComplexity int) int Notes func(childComplexity int) int Status func(childComplexity int) int Type func(childComplexity int) int UID func(childComplexity int) int Updated func(childComplexity int) int } Expenses struct { Count func(childComplexity int) int Data func(childComplexity int) int } Invoice struct { Amount func(childComplexity int) int Billing func(childComplexity int) int Code func(childComplexity int) int Contact func(childComplexity int) int Created func(childComplexity int) int Currency func(childComplexity int) int DueDate func(childComplexity int) int ID func(childComplexity int) int Metadata func(childComplexity int) int Notes func(childComplexity int) int Status func(childComplexity int) int Template func(childComplexity int) int UID func(childComplexity int) int Updated func(childComplexity int) int } Invoices struct { Count func(childComplexity int) int Data func(childComplexity int) int } Mutation struct { CreateExpense func(childComplexity int, input model.NewExpense) int CreateInvoice func(childComplexity int, input model.NewInvoice) int DeleteExpense func(childComplexity int, id string) int DeleteExpenses func(childComplexity int, ids []string) int DeleteInvoice func(childComplexity int, id string) int UpdateExpense func(childComplexity int, id string, input model.UpdateExpense) int UpdateInvoice func(childComplexity int, id string, input model.UpdateInvoice) int } Query struct { Expense func(childComplexity int, id string) int Expenses func(childComplexity int, stages map[string]interface{}) int Invoice func(childComplexity int, id string) int Invoices func(childComplexity int, stages map[string]interface{}) int // contains filtered or unexported fields } ID func(childComplexity int) int } User struct { Expenses func(childComplexity int) int ID func(childComplexity int) int Invoices 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 { Api func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) Auth func(ctx context.Context, obj interface{}, next graphql.Resolver, roles []string) (res interface{}, err error) ComposeDirective func(ctx context.Context, obj interface{}, next graphql.Resolver, name string) (res interface{}, err error) HasScope func(ctx context.Context, obj interface{}, next graphql.Resolver, scope []string) (res interface{}, err error) InterfaceObject func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) }
type EntityResolver ¶
type ExpenseResolver ¶
type ExpenseResolver interface { ID(ctx context.Context, obj *model.Expense) (string, error) Metadata(ctx context.Context, obj *model.Expense) (map[string]interface{}, error) Date(ctx context.Context, obj *model.Expense) (string, error) UID(ctx context.Context, obj *model.Expense) (string, error) Created(ctx context.Context, obj *model.Expense) (string, error) Updated(ctx context.Context, obj *model.Expense) (string, error) }
type InvoiceResolver ¶
type InvoiceResolver interface { ID(ctx context.Context, obj *model.Invoice) (string, error) Amount(ctx context.Context, obj *model.Invoice) (int, error) Billing(ctx context.Context, obj *model.Invoice) (map[string]interface{}, error) DueDate(ctx context.Context, obj *model.Invoice) (string, error) Metadata(ctx context.Context, obj *model.Invoice) (map[string]interface{}, error) UID(ctx context.Context, obj *model.Invoice) (string, error) Contact(ctx context.Context, obj *model.Invoice) (string, error) Created(ctx context.Context, obj *model.Invoice) (string, error) Updated(ctx context.Context, obj *model.Invoice) (string, error) }
type MutationResolver ¶
type MutationResolver interface { CreateExpense(ctx context.Context, input model.NewExpense) (*model.Expense, error) UpdateExpense(ctx context.Context, id string, input model.UpdateExpense) (*model.Expense, error) DeleteExpense(ctx context.Context, id string) (bool, error) DeleteExpenses(ctx context.Context, ids []string) (bool, error) CreateInvoice(ctx context.Context, input model.NewInvoice) (*model.Invoice, error) UpdateInvoice(ctx context.Context, id string, input model.UpdateInvoice) (*model.Invoice, error) DeleteInvoice(ctx context.Context, id string) (map[string]interface{}, error) }
type QueryResolver ¶
type QueryResolver interface { Expenses(ctx context.Context, stages map[string]interface{}) (*model.Expenses, error) Expense(ctx context.Context, id string) (*model.Expense, error) Invoice(ctx context.Context, id string) (*model.Invoice, error) Invoices(ctx context.Context, stages map[string]interface{}) (*model.Invoices, error) }
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func (*Resolver) Entity ¶
func (r *Resolver) Entity() EntityResolver
Entity returns EntityResolver implementation.
func (*Resolver) Expense ¶
func (r *Resolver) Expense() ExpenseResolver
Expense returns ExpenseResolver implementation.
func (*Resolver) Invoice ¶
func (r *Resolver) Invoice() InvoiceResolver
Invoice returns InvoiceResolver 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.
func (*Resolver) User ¶
func (r *Resolver) User() UserResolver
User returns UserResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { Entity() EntityResolver Expense() ExpenseResolver Invoice() InvoiceResolver Mutation() MutationResolver Query() QueryResolver User() UserResolver }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.