graphql

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHandler

func BuildHandler(s *schema.APISchema, tdb *db.TenantDB, hr *extensions.HookRunner, policy *rbac.Policy, hub *events.Hub, allowIntrospection bool) http.Handler

BuildHandler constructs an http.Handler for the /graphql endpoint. Callers must ensure tenant.TenantMiddleware runs before this handler.

allowIntrospection gates the __schema/__type introspection fields (needed by ANY schema explorer — GraphiQL, Apollo Sandbox, codegen tools) — an explicit parameter, not read from os.Getenv here, so a caller compiling several engine instances in one process (the in-process fleet, MT-STRUCT-S3) can resolve it PER APP from that app's own env/Config, not the process-wide env (GRAPHQL-EXPLORER-S1 — see app.go buildRouter and multiapp.go buildFleetApp for the resolution: Env=="development" or the explicit APPXIMO_GRAPHQL_PLAYGROUND opt-in).

func PlaygroundHandler

func PlaygroundHandler(endpoint string) http.Handler

PlaygroundHandler serves GraphiQL — the standard visual GraphQL explorer (schema browser, introspection-driven autocomplete, run queries/mutations in place, a Headers editor for testing with a real Authorization token) — mounted at /graphiql alongside REST's Swagger UI at /docs (API-PRODUCTIVA-V1), only when BuildHandler's introspection gate is open (dev, or the APPXIMO_GRAPHQL_PLAYGROUND opt-in) — GraphiQL is unusable without it.

The CDN build is version-PINNED (same discipline as openapi_serve.go's Swagger UI), not left to resolve "latest": GraphiQL dropped its standalone UMD bundle after 3.9.0 (4.x+ is ESM/import-map only), so an unpinned unpkg.com/graphiql/graphiql.min.js 404s — verified live. 3.9.0 is the last version shipping graphiql.min.js.

Types

This section is empty.

Jump to

Keyboard shortcuts

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