How do i create `skipAuth` directives.
- Dominant language
- Go
- Stars
- 10.8k
- Forks
- 1.3k
- Avg merge
- 2d 36m
- Merged PRs (30d)
- 26
Description
### What happened?
I am working on adding a skipAuth directives to queries that will render certain queries accessible to the public, provided the skipAuth directive is specified.
### What did you expect?
Referring to this document (https://gqlgen.com/reference/directives/), the directive operates subsequent to the authorization middleware. My goal is to find a strategy that facilitates the execution of the directive or checks if `skipAuth` is specified within the auth middleware before moving forward.
### Minimal graphql.schema and models to reproduce
```graphql
type Query {
gates: Gate! @skipAuth
}
```
### versions
- go run github.com/99designs/gqlgen version?
`v0.17.16`
- go version?
`go1.19.1 darwin/amd64`
Contributor guide
Research direction
The issue is about adding a @skipAuth directive that works before or within the authorization middleware. Look at the gqlgen directive documentation and the existing auth middleware implementation. Examine how directives are processed and where the auth middleware runs in the request lifecycle. Determine if a directive can be evaluated early or if the middleware needs to inspect the query AST for the directive.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, graphql
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100