ChilliCream / ChilliCream/graphql-platform

Make it simpler in `ExecutionDiagnosticEventListener.ResolverError` to distinguish between server and client errors

Open
#7,144 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate Area: Performance
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Product

Hot Chocolate

Is your feature request related to a problem?

I want to log all server errors as errors, and all client errors at a lower severity level. However, ExecutionDiagnosticEventListener.ResolverError gives me no robust way to distinguish between them.

I originally tried to base this on whether the IError passed to ResolverError contains an exception, but this does then not log errors like HC0018 "Cannot return null for non-nullable field" as errors. I can of course add this code to the check, but adding error codes as I randomly discover that something is not logged as an error is no way to go about this.

The solution you'd like

I'm open to various solutions, but it could be something as simple as a property IError.IsServerError or IError.IsClientError.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing ExecutionDiagnosticEventListener.ResolverError and the IError passed to it, including the HC0018 example. Determine how server and client errors should be distinguished reliably, then define the API behavior and verify that both exception-backed errors and errors such as non-nullability failures are classified correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.