Our solution
Add custom gateway logic without running a second process
Custom modules are Go packages linked into the router binary. Your code runs in the same process as routing and federation, so you can reuse internal clients and observability without adding another network hop or maintaining a fork.
Each interface hooks into a specific point
One module can implement several interfaces at once, and multiple modules can coexist; set priority when their relative order matters.
RouterOnRequestHandlerruns as early as possible, before built-in auth and parsing.RouterMiddlewareHandlerruns after the operation is parsed, with access to the GraphQL operation and query plan stats.EnginePreOriginHandlerandEnginePostOriginHandlerwrap each subgraph fetch and response.ProvisionerandCleanerrun at router start and shutdown for module lifecycle.At request time, handlers fire in-process in the same goroutine as the request, with access to the full request context.
One binary. Native performance. Your libraries, in-process.

