How to use the @nestjs/graphql.GraphQLModule function in @nestjs/graphql

To help you get started, we’ve selected a few @nestjs/graphql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github notadd / next / packages / server / modules / application.module.js View on Github external
.apply(apollo_server_express_1.graphiqlExpress({ endpointURL: '/graphql' }))
            .forRoutes({ path: '/graphiql', method: common_1.RequestMethod.GET })
            .apply(apollo_server_express_1.graphqlExpress(req => ({ schema, rootValue: req })))
            .forRoutes({ path: '/graphql', method: common_1.RequestMethod.ALL });
    }
    createSchema() {
        const typeDefs = this.graphQLFactory.mergeTypesByPaths('./**/*.types.graphql');
        const schema = this.graphQLFactory.createSchema({ typeDefs });
        return this.graphQLFactory.createSchema({ typeDefs });
    }
};
ApplicationModule = __decorate([
    common_1.Module({
        imports: [
            typeorm_1.TypeOrmModule.forRoot(),
            graphql_1.GraphQLModule,
            configuration_1.ConfigurationModule,
            logger_1.LoggerModule,
            setting_1.SettingModule,
            backend_1.BackendModule,
            user_1.UserModule,
            authentication_1.AuthenticationModule,
        ],
    }),
    __metadata("design:paramtypes", [graphql_1.GraphQLFactory])
], ApplicationModule);
exports.ApplicationModule = ApplicationModule;
github notadd / next / packages / graphql / modules / graphql.module.js View on Github external
}
    createSchema() {
        const paths = this.configuration.paths.concat([]);
        const typeDefs = this.graphqlFactory.mergeTypesFromPaths(paths);
        return this.graphqlFactory.createSchema({
            typeDefs,
            resolvers: {
                Json: GraphQLJSON,
            },
        });
    }
};
GraphqlModule = __decorate([
    common_1.Module({
        imports: [
            graphql_1.GraphQLModule,
        ],
        providers: [
            factories_1.GraphqlFactory,
        ],
    }),
    __metadata("design:paramtypes", [factories_1.GraphqlFactory])
], GraphqlModule);
exports.GraphqlModule = GraphqlModule;

//# sourceMappingURL=graphql.module.js.map