6.3 KiB
6.3 KiB
@suaveplan/api-graphql-apollo — Apollo Server GraphQL engine adapter for the Suaveplan API plugin system. Implements the GraphqlEngine contract from @suaveplan/api-graphql and passes runGraphqlEngineConformance with the same invariants as the Yoga sibling. Adds Apollo-specific persisted-query manifest support, optional Apollo Studio usage reporting, depth + complexity guards, federated multi-plugin schema merging, per-request DataLoader scoping, engine-agnostic OTel instruments, and graphql-ws subscription bridging.
Stage-7 Apollo Server GraphQL engine adapter for the Suaveplan API
plugin system. Implements the GraphqlEngine contract from
@suaveplan/api-graphql and passes the conformance suite alongside
the Yoga sibling — switching engines is a host-config change.
Documentation tree
- http —
endpoints/httpmounts the two HTTP endpoints every GraphQL adapter must expose:POST /graphqlfor operation dispatc… - ui-proxy —
endpoints/ui-proxymounts the/graphql/uiendpoint. The Apollo engine never embeds Apollo's landing page — UI is op… - engine —
ApolloGraphqlEngineis the concrete Apollo Server implementation of the@suaveplan/api-graphqlengine contract. It…- apollo-engine —
ApolloGraphqlEngineis the concrete Apollo Server implementation of the@suaveplan/api-graphqlengine contract. It…
- apollo-engine —
- error-codes —
error-codesdefines the stableGRAPHQL_APOLLO.*namespace plus theGraphqlApolloErrorclass consumed by every oth…- error-codes —
error-codesdefines the stableGRAPHQL_APOLLO.*namespace plus theGraphqlApolloErrorclass consumed by every oth…
- error-codes —
- federation —
federationis the engine's facade over the canonicalmergeSdlfunction from@suaveplan/api-graphql. Apollo doesn'…- federation —
federationis the engine's facade over the canonicalmergeSdlfunction from@suaveplan/api-graphql. Apollo doesn'…
- federation —
- guards —
depth-and-complexitywalks a parsedDocumentNodeand computes two coarse static metrics — the maximum selection-set…- depth-and-complexity —
depth-and-complexitywalks a parsedDocumentNodeand computes two coarse static metrics — the maximum selection-set…
- depth-and-complexity —
- instruments —
instrumentsowns the five OTel instrument names emitted by every GraphQL engine adapter in the foundation. Both `api-…- instruments —
instrumentsowns the five OTel instrument names emitted by every GraphQL engine adapter in the foundation. Both `api-…
- instruments —
- loaders —
loadersdefines the per-request DataLoader scope the engine creates around every incoming GraphQL operation. Two conc…- loaders —
loadersdefines the per-request DataLoader scope the engine creates around every incoming GraphQL operation. Two conc…
- loaders —
- options —
optionsowns the Zod-validated configuration surface accepted bycreateApolloGraphqlEngine. The schema mirrors the…- options —
optionsowns the Zod-validated configuration surface accepted bycreateApolloGraphqlEngine. The schema mirrors the…
- options —
- persisted-queries —
persisted-queriesimplements Apollo's persisted-query manifest lookup — the ability for clients to send{ id }in p…- persisted-queries —
persisted-queriesimplements Apollo's persisted-query manifest lookup — the ability for clients to send{ id }in p…
- persisted-queries —
- studio-reporting —
studio-reportingmaterialises the configuration descriptor consumed by the engine when an operator opts in to Apollo…- studio-reporting —
studio-reportingmaterialises the configuration descriptor consumed by the engine when an operator opts in to Apollo…
- studio-reporting —
- subscriptions —
subscriptionsruns a GraphQL subscription document against a wired schema, returning the `AsyncIterable<ExecutionResu…- subscriptions —
subscriptionsruns a GraphQL subscription document against a wired schema, returning the `AsyncIterable<ExecutionResu…
- subscriptions —
- testing —
testing/conformanceis the re-export ofrunGraphqlEngineConformancefrom@suaveplan/api-graphql/testing, pre-boun…- conformance —
testing/conformanceis the re-export ofrunGraphqlEngineConformancefrom@suaveplan/api-graphql/testing, pre-boun…
- conformance —
When to choose Apollo over Yoga
- You want Apollo Studio usage reporting (
studioReportingoption). - You ship persisted-query manifests built by Apollo's CLI / Rover.
- Your team already runs Apollo's federation tooling in adjacent services.
- You need Apollo's plugin ecosystem (cost analyser, request coalescer, custom cache plugin, …).
Otherwise, Yoga is the faster default — fewer allocations per request, slimmer dependency closure.
Modules
engine—ApolloGraphqlEngine,createApolloGraphqlEngine.options— Zod-validatedApolloGraphqlOptionsschema.error-codes—GRAPHQL_APOLLO.*registry +GraphqlApolloError.instruments— engine-agnosticgraphql.*OTel surface.guards— depth + complexity rejection helpers.persisted-queries— APQ manifest loader.studio-reporting— Apollo Studio descriptor bridge.subscriptions—graphql-wsrunner.loaders— per-request DataLoader scope.federation—mergeSdlpassthrough.endpoints— HTTP + UI proxy mounts.testing—runApolloConformancere-export.
Status
Original. Owned by the api-stack super-category.
Passes the abstract conformance harness with the same invariants Yoga
satisfies — see src/engine/apollo-engine.spec-conformance.test.ts.