chore: added review changes in resolver
This commit is contained in:
committed by
Balu Babu
parent
056a5df4e1
commit
63b6c76f51
@@ -23,6 +23,7 @@ import { GqlUser } from 'src/decorators/gql-user.decorator';
|
|||||||
import { GqlAuthGuard } from 'src/guards/gql-auth.guard';
|
import { GqlAuthGuard } from 'src/guards/gql-auth.guard';
|
||||||
import { User } from 'src/user/user.model';
|
import { User } from 'src/user/user.model';
|
||||||
import { PubSubService } from 'src/pubsub/pubsub.service';
|
import { PubSubService } from 'src/pubsub/pubsub.service';
|
||||||
|
import { AuthUser } from '../types/AuthUser';
|
||||||
|
|
||||||
@Resolver(() => Shortcode)
|
@Resolver(() => Shortcode)
|
||||||
export class ShortcodeResolver {
|
export class ShortcodeResolver {
|
||||||
@@ -57,7 +58,7 @@ export class ShortcodeResolver {
|
|||||||
})
|
})
|
||||||
@UseGuards(GqlAuthGuard)
|
@UseGuards(GqlAuthGuard)
|
||||||
myShortcodes(
|
myShortcodes(
|
||||||
@GqlUser() user: User,
|
@GqlUser() user: AuthUser,
|
||||||
@Args({
|
@Args({
|
||||||
name: 'cursor',
|
name: 'cursor',
|
||||||
type: () => ID,
|
type: () => ID,
|
||||||
@@ -168,7 +169,7 @@ export class ShortcodeResolver {
|
|||||||
resolve: (value) => value,
|
resolve: (value) => value,
|
||||||
})
|
})
|
||||||
@UseGuards(GqlAuthGuard)
|
@UseGuards(GqlAuthGuard)
|
||||||
myShortcodesCreated(@GqlUser() user: User) {
|
myShortcodesCreated(@GqlUser() user: AuthUser) {
|
||||||
return this.pubsub.asyncIterator(`shortcode/${user.uid}/created`);
|
return this.pubsub.asyncIterator(`shortcode/${user.uid}/created`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +178,7 @@ export class ShortcodeResolver {
|
|||||||
resolve: (value) => value,
|
resolve: (value) => value,
|
||||||
})
|
})
|
||||||
@UseGuards(GqlAuthGuard)
|
@UseGuards(GqlAuthGuard)
|
||||||
myShortcodesRevoked(@GqlUser() user: User): AsyncIterator<Shortcode> {
|
myShortcodesRevoked(@GqlUser() user: AuthUser): AsyncIterator<Shortcode> {
|
||||||
return this.pubsub.asyncIterator(`shortcode/${user.uid}/revoked`);
|
return this.pubsub.asyncIterator(`shortcode/${user.uid}/revoked`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user