[Bug] Error: [object Object] using AuthGuard with GraphQL
See original GitHub issueWhen using the AuthGuard
on a controller it works fine, but when used on a GraphQL query or mutation it shows the following error in terminal:
Probably graphql is waiting for the return of a false boolean in failure case, but authentication returns a http exception
This is my example
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Nestjs azure active directory and graphql - UseGuard
It is working just fine when I add a nestjs guard to a REST endpoint, but with a GrapQL resolver it is throwing...
Read more >Error handling - Apollo GraphQL Docs
Whenever Apollo Server encounters errors while processing a GraphQL operation, its response to the client includes an errors array containing each error that ......
Read more >Authorization - TypeGraphQL
How to use. First, we need to use the @Authorized decorator as a guard on a field, query or mutation. Example object type...
Read more >Relations | Nestjs-query - Blog
When using the nestjs-query you can specify relations that should be exposed for the ... This prevents the n+1 problem. In ... todo-item/todo-item.entity.ts....
Read more >Setting up a Hybrid REST & GraphQL API with NestJS and ...
ORMs, or object relational mappers, are libraries that simplify working with a relational or NoSQL database in our codebase.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This isn’t
AuthGuard
issue. I did a small research and it seems that this is how apollo serializes thrown error. If you throw “Test”, it would print the following output:Whilst
message
property of theHttpException
is an object. Regardless of this weird console output, the GraphQL response looks perfectly fine:Any progress?