/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
sample/23-graphql-code-first/src/app.module.ts
27 строк
884 B
Kamil Myśliwiec
sample(23-code-first): add missing directive declaration
03 мар 2022, 15:33
Не верифицирован
03 мар 2022, 15:33
db3654a
Код
Авторство
О чём код?
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo'; import { Module } from '@nestjs/common'; import { GraphQLModule } from '@nestjs/graphql'; import { DirectiveLocation, GraphQLDirective } from 'graphql'; import { upperDirectiveTransformer } from './common/directives/upper-case.directive'; import { RecipesModule } from './recipes/recipes.module'; @Module({ imports: [ RecipesModule, GraphQLModule.forRoot<ApolloDriverConfig>({ driver: ApolloDriver, autoSchemaFile: 'schema.gql', transformSchema: schema => upperDirectiveTransformer(schema, 'upper'), installSubscriptionHandlers: true, buildSchemaOptions: { directives: [ new GraphQLDirective({ name: 'upper', locations: [DirectiveLocation.FIELD_DEFINITION], }), ], }, }), ], }) export class AppModule {}