GqlModuleOptions
"GraphQLModule" options object.
interface GqlModuleOptions<TDriver extends GraphQLDriver = any> {
path?: string
typeDefs?: string | string[]
typePaths?: string[]
driver?: Type<TDriver>
include?: Function[]
directiveResolvers?: any
schema?: GraphQLSchema
resolvers?: IResolvers | Array<IResolvers>
definitions?: {...}
autoSchemaFile?: AutoSchemaFileValue
sortSchema?: boolean
buildSchemaOptions?: BuildSchemaOptions
useGlobalPrefix?: boolean
fieldResolverEnhancers?: Enhancer[]
resolverValidationOptions?: IResolverValidationOptions
inheritResolversFromInterfaces?: boolean
transformSchema?: (schema: GraphQLSchema) => GraphQLSchema | Promise<GraphQLSchema>
transformAutoSchemaFile?: boolean
context?: any
}
Properties
Property | Description |
---|---|
path?: string
|
Path to mount GraphQL API |
typeDefs?: string | string[]
|
Type definitions |
typePaths?: string[]
|
Paths to files that contain GraphQL definitions |
driver?: Type<TDriver>
|
GraphQL server adapter |
include?: Function[]
|
An array of modules to scan when searching for resolvers |
directiveResolvers?: any
|
Directive resolvers |
schema?: GraphQLSchema
|
Optional GraphQL schema (to be used or to be merged) |
resolvers?: IResolvers | Array<IResolvers>
|
Extra resolvers to be registered. |
definitions?: {
path?: string;
outputAs?: 'class' | 'interface';
} & DefinitionsGeneratorOptions
|
TypeScript definitions generator options |
autoSchemaFile?: AutoSchemaFileValue
|
If enabled, GraphQL schema will be generated automatically |
sortSchema?: boolean
|
Sort the schema lexicographically |
buildSchemaOptions?: BuildSchemaOptions
|
Options to be passed to the schema generator Only applicable if "autoSchemaFile" = true |
useGlobalPrefix?: boolean
|
Prepends the global prefix to the url |
fieldResolverEnhancers?: Enhancer[]
|
Enable/disable enhancers for @ResolveField() |
resolverValidationOptions?: IResolverValidationOptions
|
Resolver validation options. |
inheritResolversFromInterfaces?: boolean
|
Inherit missing resolvers from their interface types defined in the resolvers object. |
transformSchema?: (schema: GraphQLSchema) => GraphQLSchema | Promise<GraphQLSchema>
|
Function to be applied to the schema letting you register custom transformations. |
transformAutoSchemaFile?: boolean
|
Apply |
context?: any
|
Context function |