using the basic example and the playground reports #50
Replies: 2 comments 1 reply
-
This is the UserResolver import { Query, Resolver, } from 'type-graphql';
import { User } from './user.model';
import { UseGuards } from '@nestjs/common';
import { JwtAuthGuard } from '../guards/JwtAuthGuard';
@Resolver()
export class UserResolver {
@Query(() => [User])
@UseGuards(JwtAuthGuard)
async users() {
// Implement your logic to fetch users from a database or other data source
return [
{ id: '1', name: 'John Doe', email: '[email protected]' },
{ id: '2', name: 'Jane Doe', email: '[email protected]' },
];
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
https://github.com/MichalLytek/typegraphql-nestjs#caveats
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Below is my app.module.ts,
The program compile and run without error,
I don't apply any auth features,
and when I open the playground page
https://mysite/absproxy/5000/graphql.
The right panel always shows:
So, Can i make it work without putting auth funtion?
If no, then how to apply auth ? I am using next.js/nest.js/prisma
Beta Was this translation helpful? Give feedback.
All reactions