99designs / 99designs/gqlgen

PersistedQueryCache functionality errors are invisible for handlers/middleware

Open
#908 2 comments 1 reaction 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.