Enterprise-grade tooling for your GraphQL server
GraphQL Modules is a toolset of libraries and guidelines dedicated to creating reusable, maintainable, testable and extendable modules out of your GraphQL server. Part of the Hive ecosystem by The Guild.
- Reusable modules
- Dependency injection
- Works with any server
Built for growing teams
- Reusable modulesSplit your schema and resolvers into modules with clear boundaries, and share them between projects.
- Scalable structureA structure that keeps a large schema navigable, with one place to look for each feature of your API.
- Gradual growthStart with a single module and add more as the server grows; nothing has to be decided up front.
- TestableTest each module and provider in isolation with the built-in testing utilities and dependency injection.
A module is a schema slice
Each module owns its type definitions, resolvers and providers. The application composes them into one executable schema.
Get startedimport { createModule, gql } from 'graphql-modules';
export const usersModule = createModule({
id: 'users',
typeDefs: gql`
type User {
id: ID!
name: String!
}
type Query {
user(id: ID!): User
}
`,
resolvers: {
Query: {
user: (_root, { id }, { injector }) => injector.get(UsersService).byId(id),
},
},
});Learn more
Dependency injection
Providers, scopes and tokens: how modules share services without coupling.
DI docs →Advanced
Execution context, lifecycles, middlewares and subscriptions.
Advanced topics →API reference
Every function and type exported by graphql-modules.
API reference →
Discover the complete ecosystem of tools and libraries
Complete GraphQL Federation Stack
Our libraries to support all your GraphQL needs
Explore the Ecosystem