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):
"/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:
[[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 OpenAPIspec_hashand operationdesc_hashare cryptographically pinned against silent mutations.
All 6 Shipped NGC Adapters
| Adapter Crate | Backend Source | Batching & Safety Mechanism |
|---|---|---|
gap-ngc-openapi | OpenAPI 3.0 / REST JSON | Supports x-gap-in-param key batching + EgressGuard IP pinning. |
gap-ngc-sql | SQLite / PostgreSQL schemas | Projects foreign keys into joinable graph edges with IN (...) parameterized batches. |
gap-ngc-graphql | Existing GraphQL subgraphs | Forwards typed sub-selections via apollo-compiler validation. |
gap-ngc-grpc | gRPC / Protobuf services | Pure-Rust protox compilation with TLS/mTLS support and deadline propagation. |
gap-ngc-cli | Local CLI executables | Runs strictly under Bubblewrap/Seatbelt OS sandbox with allowlisted env vars. |
gap-ngc-code | Source codebases | Uses 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:
./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>