I'm trying to add a Custom Directive with the code first approach following the doc. For now, I use the exact same upper directive. However, the directive seems to have no effect and the code never goes through my custom function.
In the app.module.ts:
GraphQLModule.forRoot({
autoSchemaFile: 'src/schema.gql',
buildSchemaOptions: {
dateScalarMode: 'timestamp',
schemaDirectives: {
upper: UpperCaseDirective, // no effect
},
},
schemaDirectives: {
upper: UpperCaseDirective, // no effect
},
playground: true,
introspection: true,
debug: true,
// Allow guards and middleware to access req and headers
context: ({ req }) => ({
req,
headers: req.headers,
databaseConnection: req.databaseConnection,
updatedAt: req.updatedAt,
}),
}),
Here are the dependencies in my package.json:
{
"dependencies": {
"@nestjs/common": "^7.3.2",
"@nestjs/core": "^7.3.2",
"@nestjs/graphql": "^7.5.5",
"@nestjs/jwt": "^7.1.0",
"@nestjs/passport": "^7.1.0",
"@nestjs/platform-express": "^7.3.2",
"@nestjs/typeorm": "^7.1.0",
"@types/dotenv": "^4.0.3",
"@types/faker": "^4.1.8",
"@types/redis": "^2.8.14",
"@types/request": "^2.48.3",
"apollo-server": "2.15.1",
"apollo-server-express": "2.15.1",
"argon2": "^0.24.1",
"class-transformer": "^0.2.3",
"class-validator": "^0.11.0",
"cookie-parser": "^1.4.4",
"dataloader": "^2.0.0",
"dotenv": "^6.0.0",
"express": "^4.17.1",
"faker": "^4.1.0",
"graphql": "15.3.0",
"handlebars": "^4.7.6",
"jsonwebtoken": "^8.5.1",
"nestjs-graphql-dataloader": "^0.1.28",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"pg": "^7.14.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.0",
"rxjs": "^6.5.3",
"typeorm": "^0.2.24",
"typeorm-seeding": "^1.6.1",
"uuid": "^3.3.3"
},
}