Native Graph Connectors (NGC)

Native Graph Connectors (NGC) let you project existing REST APIs, SQL databases, gRPC services, GraphQL subgraphs, CLIs, and AST codebases into one unified graph without hand-writing glue resolvers.

What you'll learn

  • Walk through connecting an OpenAPI REST endpoint declaratively using x-gap-in-param.
  • Compare all 6 shipped NGC adapters and their batching/sandbox behavior.
  • How Propose-Not-Activate validates joins before any live traffic sees a new schema.
On this page

How a REST API Becomes a Graph Branch

Given an upstream REST endpoint like GET /customers/{id} paired with list batching GET /customers?ids=1,2,3, declare the "x-gap-in-param" extension inside your OpenAPI operation (verbatim from examples/walking-skeleton/shop.openapi.json):

json examples/walking-skeleton/shop.openapi.json
"/customers/{id}": {
  "get": {
    "operationId": "customer",
    "x-gap-in-param": {
      "path": "/customers",
      "param": "ids",
      "key_field": "id",
      "max_batch_size": 50
    }
  }
}

Then wire the OpenAPI file into gap.toml:

toml gap.toml — OpenAPI Branch
[[branches]]
id = "shop"
protocol = "openapi"
trust = "T1"

[branches.openapi]
spec = "shop.openapi.json"
base_url = "http://127.0.0.1:9101"
  • id = "shop": Stable branch identifier scoping generated GraphQL types (shop_CustomersResult, shop_OrdersResult) and audit logs.
  • trust = "T1": Admin-approved branch whose OpenAPI spec_hash and operation desc_hash are cryptographically pinned against silent mutations.

All 6 Shipped NGC Adapters

Capabilities of the 6 reference Native Graph Connectors
Adapter CrateBackend SourceBatching & Safety Mechanism
gap-ngc-openapiOpenAPI 3.0 / REST JSONSupports x-gap-in-param key batching + EgressGuard IP pinning.
gap-ngc-sqlSQLite / PostgreSQL schemasProjects foreign keys into joinable graph edges with IN (...) parameterized batches.
gap-ngc-graphqlExisting GraphQL subgraphsForwards typed sub-selections via apollo-compiler validation.
gap-ngc-grpcgRPC / Protobuf servicesPure-Rust protox compilation with TLS/mTLS support and deadline propagation.
gap-ngc-cliLocal CLI executablesRuns strictly under Bubblewrap/Seatbelt OS sandbox with allowlisted env vars.
gap-ngc-codeSource codebasesUses tree-sitter AST indexing (calls, imports, symbols) for 208x token savings.

Safe Activation: Propose-Not-Activate & @join Verification

Newly ingested schemas never auto-publish directly into request execution. Instead, gap ingest once compiles a Candidate Intermediate Schema Graph (CISG), runs sample data verification on proposed @join edges (checking containment & null rates, never LLM guesswork), and queues a Proposal for operator review:

terminal Terminal — Ingest, Diff & Proposal Approval
./target/dist/gap ingest once --config examples/walking-skeleton/gap.toml --tenant default
./target/dist/gap proposals list
./target/dist/gap snapshot show --config examples/walking-skeleton/gap.toml
./target/dist/gap snapshot diff --before gap.toml --after gap.next.toml
./target/dist/gap proposals approve <proposal-id>