Documentation
¶
Overview ¶
Package graph is a Base's records as a typed GraphQL schema: one object type per collection, with its fields, its relations and the records that point at it; a filter input per collection whose operators per field type are the where clause's (core.CompileWhere); an orderBy; cursor connections with a total; aggregates; create, update, upsert and delete; and each record's history.
It has no transport and no second authorization. The schema is rendered from the Base's own collections, so it is per Base and changes with them, and every field is answered by a request on the Base's own router made as the caller: the record routes, the aggregate route and the history route, with their list and view rules, their tenancy and their rate limits, are the REST path's. zip's engine parses, binds variables and fragments, applies the bounds and the request's resolution budget, and projects each answer through its selection (zip.MountGraphFor). A host mounts it with the router it serves the Base with:
g := graph.New(app, router)
zipApp.MountGraphFor("/v1/base/graphql", g.Schema, g.Resolve)
There are no subscriptions: realtime is Base's own SSE stream, under the same rules, and a client refetches what changed by id.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph is one Base's records as GraphQL.
func New ¶
New serves app's records, answering every field through router, the handler that serves app's REST routes.