// the find
graphql-hive/graphql-modules
Enterprise Grade Tooling For Your GraphQL Server
GraphQL Modules is a library for splitting a GraphQL server into independently scoped, composable modules, each owning its own type definitions, resolvers, and injected providers. It ships a full Angular-style dependency injection system adapted for per-request and per-module scopes. Aimed at teams building large GraphQL APIs where a single monolithic schema file becomes a maintenance problem.
The DI system is the real feature here — providers can be scoped to singleton, per-module, or per-operation, which lets you share a DataLoader across a request without global state hacks. The testing utilities (`testkit`, `createTestingModule`) let you mount individual modules in isolation with mocked providers, which is rare in the GraphQL ecosystem. Schema-first design means type merging across modules is handled for you rather than requiring manual stitching. The Guild maintains it actively and it integrates cleanly with both Apollo Server and GraphQL Yoga.
The decorator-based DI (`@Injectable`, `@Inject`) requires `experimentalDecorators` and `emitDecoratorMetadata` in TypeScript config, which is a friction point with modern TS setups moving away from legacy decorators. Documentation examples lean heavily on simple CRUD cases; how modules interact when they share types across domain boundaries (e.g., User referenced in three modules) is undersold and becomes complex in practice. At 1.3k stars for a library that's been around since 2019, adoption is modest — the ecosystem bet on code-first schema builders like Pothos instead, so community answers are thin. No built-in federation support beyond a basic compatibility shim, so if you're on Apollo Federation this library adds friction rather than removing it.