graphqlwiring

package
v1.131.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package graphqlwiring attaches the platform's dependencies to the live graphql toolkits and brings their schemas up.

It exists here rather than on the platform facade for the reason the other seams under internal/platform do: the facade is at its size budget, and a connection kind's wiring is cohesive enough to own its own file. pkg/platform keeps one thin entry point that assembles the dependencies it holds and hands them over.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Toolkits

func Toolkits(reg *registry.Registry) []*graphqlkit.Toolkit

Toolkits returns the live graphql toolkits in a registry.

func Wire

func Wire(ctx context.Context, d Deps)

Wire attaches every dependency and then reads each connection's schema: the stored one when the store holds it, a fresh introspection otherwise. Schemas are read last because the read goes through the connection's own credential and its own transport, both of which the steps above install.

Every step is nil-safe and idempotent, so Wire is safe to call once per boot whatever the deployment is missing.

Types

type Deps

type Deps struct {
	// Registry holds the live toolkits.
	Registry *registry.Registry
	// DB backs the schema store and the operation-embedding reads. Nil
	// keeps schemas in memory for the process's life.
	DB *sql.DB
	// Embedder embeds a caller's query for semantic and hybrid ranking.
	Embedder embedding.Provider
	// RoutePolicy authorizes one operation. Nil leaves the platform's
	// tool and connection gates as the only ones.
	RoutePolicy *routepolicy.Policy
	// OAuthStore and AuthEvents back the authorization_code grant.
	OAuthStore connoauth.Store
	AuthEvents *authevents.Writer
	// MemBudget is the process-wide in-flight response budget, shared
	// with the other buffered gateway kinds.
	MemBudget *membudget.Budget
	// Metrics instruments outbound calls.
	Metrics *observability.Metrics
	// Export enables graphql_export. Nil leaves the tool unregistered.
	Export *graphqlkit.ExportDeps
}

Deps is everything the graphql kind needs from the platform. Every field is optional: a deployment with no database, no embedding provider or no portal still runs graphql connections, with the capabilities those dependencies enable absent rather than the connection broken.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL