Documentation
¶
Overview ¶
Package dataloader provides DataLoader middleware for batching relationship queries. It prevents N+1 query problems when traversing GraphQL relationships by collecting individual entity lookups within a batching window and executing them as a single query.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Loaders ¶
type Loaders struct {
OrganizationByID *dataloadgen.Loader[int, *ent.Organization]
NetworkByID *dataloadgen.Loader[int, *ent.Network]
FacilityByID *dataloadgen.Loader[int, *ent.Facility]
InternetExchangeByID *dataloadgen.Loader[int, *ent.InternetExchange]
IxLanByID *dataloadgen.Loader[int, *ent.IxLan]
CarrierByID *dataloadgen.Loader[int, *ent.Carrier]
CampusByID *dataloadgen.Loader[int, *ent.Campus]
}
Loaders holds all DataLoader instances for a single request.
func NewLoaders ¶
NewLoaders creates a new set of DataLoaders backed by the given ent client.
Click to show internal directories.
Click to hide internal directories.