graphile / graphile/crystal

extendedErrors: ['role']

Open
#1,697 7 comments 0 reactions 0 assignees View on GitHub
💅 enhancement
Dominant language
TypeScript
Stars
12.9k
Forks
625
Avg merge
5h 23m
Merged PRs (30d)
24

Description

### Feature description

When you get a permission denied error from Postgraphile, it can be difficult to debug, because you have no way of knowing what role Postgraphile is using.

It would be nice if you could specify `"role"` under the `extendedErrors` configuration to tell Postgraphile to provide it (and it'd similarly be nice if it was provided to `handleErrors`).

### Motivating example

1. Setup a user that has permission to edit table X in the database
2. Try to edit table X through Postgrapile API (while using a JWT for that user)
3. Get a permission denied error
4. Be stuck and have no idea how to see *why* Postgraphile gave a permission denied

### Breaking changes

It shouldn't.

### Supporting development

I [tick all that apply]:

- [ ] am interested in building this feature myself
- [X] am interested in collaborating on building this feature
- [X] am willing to help testing this feature before it's released
- [ ] am willing to write a test-driven test suite for this feature (before it exists)
- [ ] am a [Graphile sponsor](https://www.graphile.org/sponsor/) ❤️
- [ ] have an active [support or consultancy contract](https://www.graphile.org/support/) with Graphile

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.