API Reference
API Reference — GraphQL Modules documentation.
CONTEXT
CONTEXT is an InjectionToken representing the provided GraphQLModules.GlobalContext
MODULE_ID
MODULE_ID is an InjectionToken representing module’s ID
Application
A return type of createApplication function.
typeDefs- A list of type definitions defined by modules.resolvers- An object with resolve functions defined by modules.schema- Ready to use GraphQLSchema object combined from modules.injector- The application (Singleton) injector.createOperationController- Take over control of GraphQL OperationcreateSubscription- Creates asubscribefunction that runs the subscription phase of GraphQL. Important when using GraphQL Subscriptions.createExecution- Creates aexecutefunction that runs the execution phase of GraphQL. Important when using GraphQL Queries and Mutations.createApolloExecutor- Creates anexecutorforApolloServer
ApplicationConfig
Application’s configuration object. Represents the first argument of createApplication function.
modules- A list of GraphQL Modulesproviders- A list of Providers - read the “Providers and Tokens” chapter.middlewares- A map of middlewares - read the “Middlewares” chapter.schemaBuilder- Creates a GraphQLSchema object out of typeDefs and resolvers
createApplication
Creates Application out of Modules. Accepts ApplicationConfig.
createModule
Creates a Module, an element used by Application. Accepts ModuleConfig.
ModuleConfig
Module’s configuration object. Represents the first argument of createModule function.
id- Unique identifier of a moduledirname- Pass__dirnamevariable as a value to get better error messages.typeDefs- An object or a list of GraphQL type definitions (SDL).resolvers- An object or a list of GraphQL resolve functions.middlewares- A map of middlewares - read the “Middlewares” chapter.providers- A list of Providers - read the “Providers and Tokens” chapter.