Documentation ¶
Overview ¶
Package graphapi contains the GraphQL resolvers for tenant-api.
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type EntityResolver
- type Handler
- type MutationResolver
- type QueryResolver
- type Resolver
- type ResolverRoot
- type TenantCreatePayload
- type TenantDeletePayload
- type TenantUpdatePayload
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 { Entity struct { FindTenantByID func(childComplexity int, id gidx.PrefixedID) int } Mutation struct { TenantCreate func(childComplexity int, input generated.CreateTenantInput) int TenantDelete func(childComplexity int, id gidx.PrefixedID) int TenantUpdate func(childComplexity int, id gidx.PrefixedID, input generated.UpdateTenantInput) int } PageInfo struct { EndCursor func(childComplexity int) int HasNextPage func(childComplexity int) int HasPreviousPage func(childComplexity int) int StartCursor func(childComplexity int) int } Query struct { Tenant func(childComplexity int, id gidx.PrefixedID) int // contains filtered or unexported fields } Tenant struct { Children func(childComplexity int, after *entgql.Cursor[gidx.PrefixedID], first *int, before *entgql.Cursor[gidx.PrefixedID], last *int, orderBy *generated.TenantOrder, where *generated.TenantWhereInput) int CreatedAt func(childComplexity int) int Description func(childComplexity int) int ID func(childComplexity int) int Name func(childComplexity int) int Parent func(childComplexity int) int UpdatedAt func(childComplexity int) int } TenantConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } TenantCreatePayload struct { Tenant func(childComplexity int) int } TenantDeletePayload struct { DeletedID func(childComplexity int) int } TenantEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } TenantUpdatePayload struct { Tenant func(childComplexity int) int } // contains filtered or unexported fields }
type Config ¶
type Config struct { Schema *ast.Schema Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type EntityResolver ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is an http handler wrapping a Resolver
func (*Handler) Handler ¶
func (h *Handler) Handler() http.HandlerFunc
Handler returns the http.HandlerFunc for the GraphAPI
type MutationResolver ¶
type MutationResolver interface { TenantCreate(ctx context.Context, input generated.CreateTenantInput) (*TenantCreatePayload, error) TenantUpdate(ctx context.Context, id gidx.PrefixedID, input generated.UpdateTenantInput) (*TenantUpdatePayload, error) TenantDelete(ctx context.Context, id gidx.PrefixedID) (*TenantDeletePayload, error) }
type QueryResolver ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver provides a graph response resolver
func NewResolver ¶
func NewResolver(client *ent.Client, logger *zap.SugaredLogger) *Resolver
NewResolver returns a resolver configured with the given ent client
func (*Resolver) Entity ¶
func (r *Resolver) Entity() EntityResolver
Entity returns EntityResolver 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.
type ResolverRoot ¶
type ResolverRoot interface { Entity() EntityResolver Mutation() MutationResolver Query() QueryResolver }
type TenantCreatePayload ¶
Return response from tenantCreate.
type TenantDeletePayload ¶
type TenantDeletePayload struct { // The ID of the deleted tenant. DeletedID gidx.PrefixedID `json:"deletedID"` }
Return response from tenantDelete.
type TenantUpdatePayload ¶
Return response from tenantUpdate.
Click to show internal directories.
Click to hide internal directories.