Conversation
Codecov Report
@@ Coverage Diff @@
## develop #287 +/- ##
===========================================
- Coverage 83.05% 78.55% -4.51%
===========================================
Files 71 79 +8
Lines 1216 1413 +197
Branches 60 74 +14
===========================================
+ Hits 1010 1110 +100
- Misses 186 283 +97
Partials 20 20
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
| * Protect a query or mutation by specific roles. Also implemments GQLAuthGuard | ||
| * @param roles List of RoleType's to auth a query/mutation/etc | ||
| */ | ||
| export const Roles = (...roles: (keyof typeof RoleType)[]) => applyDecorators( |
There was a problem hiding this comment.
The standard seems to be that decorators are defined in their own file.
E.g.
- CurrentUser.decorator.ts
- https://docs.nestjs.com/guards
Can this be moved to a roles.decorator.ts file?
| */ | ||
| export const Roles = (...roles: (keyof typeof RoleType)[]) => applyDecorators( | ||
| SetMetadata('roles', roles), | ||
| UseGuards(GQLAuthGuard, RoleGuard) |
There was a problem hiding this comment.
NestJS documentation related to creating a roles decorator doesn't use UseGuard in their example.
Can you explain the need for UseGuards(GQLAuthGuard, RoleGuard) here?
|
Hey @RosoPenaranda how's it going with this one? |
|
I'm going to take over this one tonight, as it's over a month old |
IMPORTANT: Please do not create a Pull Request without creating an issue first.
Fixed issues (PRs without this will not be accepted)
Changes
PR Checklist
yarn lintoryarn lint:fixyarn build