feat: wip casl policies (#334)
* feat: wip casl policies * feat: add ability guard on pipeline resolvers * fix: test
This commit is contained in:
@ -5,9 +5,11 @@ import { AppService } from './app.service';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { CoreModule } from './core/core.module';
|
||||
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
|
||||
import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default';
|
||||
import { GraphQLError } from 'graphql';
|
||||
import { PrismaModule } from './database/prisma.module';
|
||||
import { HealthModule } from './health/health.module';
|
||||
import { AbilityModule } from './ability/ability.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@ -15,9 +17,11 @@ import { HealthModule } from './health/health.module';
|
||||
isGlobal: true,
|
||||
}),
|
||||
GraphQLModule.forRoot<ApolloDriverConfig>({
|
||||
playground: false,
|
||||
context: ({ req }) => ({ req }),
|
||||
driver: ApolloDriver,
|
||||
autoSchemaFile: true,
|
||||
plugins: [ApolloServerPluginLandingPageLocalDefault()],
|
||||
formatError: (error: GraphQLError) => {
|
||||
error.extensions.stacktrace = undefined;
|
||||
return error;
|
||||
@ -25,6 +29,7 @@ import { HealthModule } from './health/health.module';
|
||||
}),
|
||||
PrismaModule,
|
||||
HealthModule,
|
||||
AbilityModule,
|
||||
CoreModule,
|
||||
],
|
||||
providers: [AppService],
|
||||
|
||||
Reference in New Issue
Block a user