OpenAPI
Expose selected OpenAPI GET operations as root fields or row joins in GraphQL.
Join remote APIs to database rows
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: invoicesquery ($id: ID!) {
customers(id: $id) {
email
invoices {
id
status
total
}
}
}Verified by
Example_queryWithOpenAPIJoin
tests/openapi_test.go:31Verified by
Example_queryWithOpenAPITopLevel
tests/openapi_toplevel_test.go:29Classification
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:
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:142Remote 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