graphql-go / graphql-go/graphql

Panics are treated like exceptions, causing information leakage

Open
#402 0 comments 13 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

When a resolver panics, the current implementation:

a. Recovers from the panic
b. Returns the error from the panic to the user in the GraphQL error list

See https://github.com/graphql-go/graphql/blob/master/executor.go#L38

Panics in go are meant to be game over, cannot continue, so if a critical issue is encountered where the program cannot continue, the last thing I want to do is continue AND leak details of the panic to my end users.

Can we at least make panic recovery optional, or ideally remove it altogether?

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.