Open shynome opened 5 years ago
from https://github.com/19majkel94/type-graphql/issues/135#issuecomment-423345833
I have this working without needing anything fancy
import { Injectable, Logger } from '@nestjs/common'; import { GqlOptionsFactory, GqlModuleOptions } from '@nestjs/graphql'; import { buildSchema } from 'type-graphql'; @Injectable() export class GraphqlConfigService implements GqlOptionsFactory { async createGqlOptions(): Promise<GqlModuleOptions> { const schema = await buildSchema({ resolvers: [__dirname + '../**/*.resolver.ts'], }); return { debug: true, playground: true, schema, }; } }
And then in the app.module...
imports: [ GraphQLModule.forRootAsync({ useClass: GraphqlConfigService, }), ],
from https://github.com/19majkel94/type-graphql/issues/135#issuecomment-423345833
I have this working without needing anything fancy
And then in the app.module...