PersistedQueryCache functionality errors are invisible for handlers/middleware
- Dominant language
- Go
- Stars
- 10.8k
- Forks
- 1.3k
- Avg merge
- 2d 36m
- Merged PRs (30d)
- 26
Description
### What happened?
Errors that comes from APQ (PersistedQueryCache) functionality are not catchable in the error presenter `handler.ErrorPresenter` and also any other kind of middleware e.g.`handler.RequestMiddleware`, `handler.ResolverMiddleware`.
The problem probably is that `sendErrorf` function writes directly to the `http.ResponseWriter` and does nothing with the context or whatever abstraction the `handler.ErrorPresenter` works with.
### What did you expect?
Errors that come from APQ (PersistedQueryCache) e.g PersistedQueryNotFound, Unsupported persisted query version, provided sha does not match query, Must provide query string, are present in the context or in the error presenter `handler.ErrorPresenter` so they can be logged, traced, and/or CDN caching can be disabled for them via adding headers to the response.
### Minimal graphql.schema and models to reproduce
any schema would work
### versions
- `gqlgen version`? v0.10.1
- `go version`? go version go1.13.1 darwin/amd64 /but not related I think/
- dep or go modules?
Contributor guide
Assessment
This issue has not been assessed yet.