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
Add info to custom resolvers and add formatError to GraphQL service #6524
Conversation
Signed-off-by: harimkims <harimkims@gmail.com>
30db2c0
to
9471d8a
Compare
Codecov Report
@@ Coverage Diff @@
## master #6524 +/- ##
==========================================
+ Coverage 19.85% 19.98% +0.13%
==========================================
Files 857 858 +1
Lines 12076 12097 +21
Branches 1963 1965 +2
==========================================
+ Hits 2398 2418 +20
- Misses 8093 8094 +1
Partials 1585 1585
Continue to review full report at Codecov.
|
Signed-off-by: harimkims <harimkims@gmail.com>
2bc2f6a
to
f7fba97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…trapi#6524) * Add info to custom resolvers, add formatError to GraphQL service Signed-off-by: harimkims <harimkims@gmail.com> * remove format-error service and use config instead Signed-off-by: harimkims <harimkims@gmail.com>
Description of what you did:
1. Add
info
to custom resolversI added info argument to custom resolvers, which has useful informations such as operation name, request query body and so on.
2. Add
formatError
serviceApollo-server supports formatting error, but so far there has been no way to use this option. So I add
formatError
service and connect to ApolloServer options, so that users can customize it by adding service inextensions/graphql/services/format-error.js
.Usage example
As you see in the example, it's useful when you use error tracking tools like Sentry. For now you can't capture GraphQL error anywhere, because GraphQL plugin hook runs after all middleware and hooks.