OpenAPI Expose selected OpenAPI GET operations as root fields or row joins in GraphQL. integrations guide integrations/openapi integrations/openapi.md

OpenAPI

Expose selected OpenAPI GET operations as root fields or row joins in GraphQL.

Join remote APIs to database rows

YAML
sources:
  - name: billing_api
    kind: api
    specs_dir: config/specs
    specs:
      stripe:
        base_url: "https://api.stripe.com"
        auth:
          scheme: bearer
          token: ${STRIPE_TOKEN}
        joins:
          listInvoices:
            parent_table: customers
            parent_column: stripe_customer_id
            param: customer
            expose_as: invoices
GraphQL
query ($id: ID!) {
  customers(id: $id) {
    email
    invoices {
      id
      status
      total
    }
  }
}
OpenAPI specGET operationsClassify + maproot fields · row joinsauth · concurrency capsGraphQL fieldjoinableREST APIDatabase rows can feed path or query parameters, so remote records appear beside SQL data in one response.

Verified by Example_queryWithOpenAPIJoin tests/openapi_test.go:31
Verified by Example_queryWithOpenAPITopLevel tests/openapi_toplevel_test.go:29

Classification

GraphJin classifies supported GET operations as row joins, top-level single-record fields, or top-level list fields. Mutating verbs, binary responses, async responses, and unsupported auth are skipped with boot-time diagnostics.

Top-level operations can sit beside database roots in one query:

GraphQL
query {
  users(limit: 2, order_by: { id: asc }) {
    id
    email
  }
  payments_api(limit: 2) {
    id
    amount
  }
}
Verified by Example_queryMixedRootDBPlusOpenAPI tests/openapi_toplevel_test.go:142

Remote API joins are executed after the parent database rows are known. The response cache keys include a resolver fingerprint so changing an upstream resolver does not reuse stale remote fragments.

Verified by TestRemoteFragmentKeyIncludesResolverFingerprint core/cache_response_test.go:163
Docs