feat: infra type added in admin module

This commit is contained in:
Mir Arif Hasan
2023-10-11 16:16:16 +06:00
parent d1c9c3583f
commit 72a753b3d6
2 changed files with 8 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import {
Subscription, Subscription,
} from '@nestjs/graphql'; } from '@nestjs/graphql';
import { Admin } from './admin.model'; import { Admin } from './admin.model';
import { Infra } from './infra.model';
import { UseGuards } from '@nestjs/common'; import { UseGuards } from '@nestjs/common';
import { GqlAuthGuard } from '../guards/gql-auth.guard'; import { GqlAuthGuard } from '../guards/gql-auth.guard';
import { GqlAdminGuard } from './guards/gql-admin.guard'; import { GqlAdminGuard } from './guards/gql-admin.guard';
@@ -32,7 +33,7 @@ import { GqlThrottlerGuard } from 'src/guards/gql-throttler.guard';
import { SkipThrottle } from '@nestjs/throttler'; import { SkipThrottle } from '@nestjs/throttler';
@UseGuards(GqlThrottlerGuard) @UseGuards(GqlThrottlerGuard)
@Resolver(() => Admin) @Resolver(() => Infra)
export class AdminResolver { export class AdminResolver {
constructor( constructor(
private adminService: AdminService, private adminService: AdminService,
@@ -41,11 +42,11 @@ export class AdminResolver {
/* Query */ /* Query */
@Query(() => Admin, { @Query(() => Infra, {
description: 'Gives details of the admin executing this query', description: 'Gives details of the admin executing this query',
}) })
@UseGuards(GqlAuthGuard, GqlAdminGuard) @UseGuards(GqlAuthGuard, GqlAdminGuard)
admin(@GqlAdmin() admin: Admin) { infra(@GqlAdmin() admin: Admin) {
return admin; return admin;
} }

View File

@@ -0,0 +1,4 @@
import { ObjectType } from '@nestjs/graphql';
@ObjectType()
export class Infra {}