feat: infra type added in admin module
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
packages/hoppscotch-backend/src/admin/infra.model.ts
Normal file
4
packages/hoppscotch-backend/src/admin/infra.model.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
|
@ObjectType()
|
||||||
|
export class Infra {}
|
||||||
Reference in New Issue
Block a user