Documentation
¶
Index ¶
- Variables
- func ErrNodeNotFound(id interface{}) *gqlerror.Error
- type Annotation
- type Transactioner
- func (Transactioner) ExtensionName() string
- func (t Transactioner) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
- func (Transactioner) MutateOperationContext(_ context.Context, oc *graphql.OperationContext) *gqlerror.Error
- func (t Transactioner) Validate(graphql.ExecutableSchema) error
- type TxOpener
- type TxOpenerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CollectionTemplate adds fields collection support using auto eager-load ent edges. // More info can be found here: https://spec.graphql.org/June2018/#sec-Field-Collection. CollectionTemplate = parse("template/collection.tmpl") // EnumTemplate adds a template implementing MarshalGQL/UnmarshalGQL methods for enums. EnumTemplate = parse("template/enum.tmpl") // NodeTemplate implements the Relay Node interface for all types. NodeTemplate = parse("template/node.tmpl") // PaginationTemplate adds pagination support according to the GraphQL Cursor Connections Spec. // More info can be found in the following link: https://relay.dev/graphql/connections.htm. PaginationTemplate = parse("template/pagination.tmpl") // TransactionTemplate adds support for ent.Client for opening transactions for the transaction // middleware. See transaction.go for for information. TransactionTemplate = parse("template/transaction.tmpl") // EdgeTemplate adds edge resolution using eager-loading with a query fallback. EdgeTemplate = parse("template/edge.tmpl") // AllTemplates holds all templates for extending ent to support GraphQL. AllTemplates = []*gen.Template{ CollectionTemplate, EnumTemplate, NodeTemplate, PaginationTemplate, TransactionTemplate, EdgeTemplate, } )
Functions ¶
func ErrNodeNotFound ¶
ErrNodeNotFound creates a node not found graphql error.
Types ¶
type Annotation ¶
type Annotation struct { // OrderField is the ordering field as defined in graphql schema. OrderField string // Bind implies the edge field name in graphql schema // is equivalent to the name used in ent schema. Bind bool // Mapping is the edge field names as defined in graphql schema. Mapping []string }
Annotation annotates fields and edges with metadata for templates.
func OrderField ¶
func OrderField(name string) Annotation
OrderField returns an order field annotation.
func (Annotation) Merge ¶
func (a Annotation) Merge(other schema.Annotation) schema.Annotation
Merge implements the schema.Merger interface.
type Transactioner ¶
type Transactioner struct{ TxOpener }
Transactioner for graphql mutations.
func (Transactioner) ExtensionName ¶
func (Transactioner) ExtensionName() string
ExtensionName returns the extension name.
func (Transactioner) InterceptResponse ¶
func (t Transactioner) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response
InterceptResponse runs graphql mutations under a transaction.
func (Transactioner) MutateOperationContext ¶
func (Transactioner) MutateOperationContext(_ context.Context, oc *graphql.OperationContext) *gqlerror.Error
MutateOperationContext serializes field resolvers during mutations.
func (Transactioner) Validate ¶
func (t Transactioner) Validate(graphql.ExecutableSchema) error
Validate is called when adding an extension to the server, it allows validation against the servers schema.
type TxOpenerFunc ¶
The TxOpenerFunc type is an adapter to allow the use of ordinary functions as tx openers.
Directories
¶
Path | Synopsis |
---|---|
Package internal Code generated by go-bindata.
|
Package internal Code generated by go-bindata. |
todopulid/ent/schema/pulid
Package pulid implements the pulid type.
|
Package pulid implements the pulid type. |
Click to show internal directories.
Click to hide internal directories.