Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Log GraphQLErrors so that stacktraces can be properly sourcemapped #2504

Open
hkung77 opened this issue Aug 16, 2024 · 1 comment
Labels
Feature Request Request for new functionality to support use cases not already covered Needs Investigation

Comments

@hkung77
Copy link

hkung77 commented Aug 16, 2024

🔎 Search Terms

GraphQLError

The vision

Can winston logger decypher GraphQLErrors such that stacktraces are properly captured and can be applied to sourcemaps.

Use case

GraphQLErrors is a custom error type from GraphQL and often the response do not follow standard JS Error Object.
When winston is logging these errors to Datadog, it doesn't not properly capture the stacktrace causing issues to integrate with other features such as source-mapping.

Additional information

No response

@hkung77 hkung77 added Feature Request Request for new functionality to support use cases not already covered Needs Investigation labels Aug 16, 2024
@DABH
Copy link
Contributor

DABH commented Nov 1, 2024

I think the right solution though might be a custom formatter since GraphQL types are not built-in JS types. Like write a formatter that formats GraphQLErrors in the proper way, and just use that formatter whenever you're working with logs that you know are going to be GraphQL logs. If community members think the right solution is a core change to Winston itself, a PR would be welcomed to see what that would look like.

@winstonjs winstonjs deleted a comment from jazanne Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Request for new functionality to support use cases not already covered Needs Investigation
Projects
None yet
Development

No branches or pull requests

2 participants