Not Authorised Error even when i doesn't apply any rule to it.
See original GitHub issueconst { shield, and, } = require('graphql-shield');
const { isAuthenticated, onlyCompany, onlyUser, ownJobOnly } = require('./authUtils');
module.exports = shield({
Query: {
user: and(isAuthenticated, onlyUser)
},
Mutation: {
updateJob: and(isAuthenticated, onlyCompany, ownJobOnly),
deleteJob: and(isAuthenticated, onlyCompany, ownJobOnly),
createJob: and(isAuthenticated, onlyCompany),
}
})
and myMutation is
mutation{
askQuestion(title: "any question", companyId: "flkjdsofiajwek" ) {
id
title
}
i got not authorised Error
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
401 Unauthorized Error: What It Is and How to Fix It
The 401 Unauthorized Error is an HTTP response status code indicating that the client could not authenticate a request.
Read more >403 Forbidden vs 401 Unauthorized HTTP responses
There's a problem with 401 Unauthorized, the HTTP status code for authentication errors. And that's just it: it's for authentication, not authorization.
Read more >When I went to use my credit card the store told me ...
If a charge is not authorized, it usually means that there is a problem with the account or that you are at, near,...
Read more >HTTP Error 403 Forbidden: What It Means and How to Fix It
The 403 (Forbidden) status code indicates that the server understood the request but refuses to authorize it... If authentication credentials ...
Read more >How to Quickly Fix the 401 Unauthorized Error (5 Methods)
The 401 (Unauthorized) status code indicates that the request has not been applied because it lacks valid authentication credentials for the ...
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
Try setting
debug
option totrue
. This wayshield
won’t mask internal errors.Thanks mate for your time. it’s not issue in Graphql-shield. it’s because of my resolver. some error was there but shows ‘Not Authorised!’ Error so i thought it’s because of Graphql-shield