ChilliCream / ChilliCream/graphql-platform
Being able to log errors in Error middleware
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Is your feature request related to a problem?
I'm using Mutation Conventions to handle errors by decorating my mutations with [Error(typeof(ValidationException))]. This works well by handling errors for me and I'm able to retrieve the error in the payload just fine. However I want to catch these errors somewhere so I can log them. I tried using IErrorFilter, but it doesn't catch errors when they are defined with the annotation. I also tried using ExecutionDiagnosticEventListener, but didn't find any events that listened to it.
The solution you'd like
Probably a method in ExecutionDiagnosticEventListener that could be overridden to catch the error message for errors, and be able to inject my logger and log them.
Product
Hot Chocolate
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Error middleware and Mutation Conventions handling around the [Error(typeof(ValidationException))] annotation, then compare the existing IErrorFilter and ExecutionDiagnosticEventListener extension points. Confirm how annotated errors flow into the payload and determine the appropriate listener entry point. Done means those errors can be observed for logging without breaking their existing payload handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, graphql
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100