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
Allow data and errors to be returned with DataFetcherResult #342
Conversation
Fixes ExpediaGroup#244 Rebase of ExpediaGroup#245 Kotlin functions can now return a DataFetcherResult instead of just their return type which allows you to modify the errors field with any extra data you need
Codecov Report
@@ Coverage Diff @@
## master #342 +/- ##
============================================
- Coverage 96.82% 96.73% -0.09%
+ Complexity 278 275 -3
============================================
Files 81 82 +1
Lines 976 980 +4
Branches 180 182 +2
============================================
+ Hits 945 948 +3
Misses 6 6
- Partials 25 26 +1
Continue to review full report at Codecov.
|
Do we need to support monads? |
@dkuc84 Do you mean |
Yes + custom monads that can be configured (e.g. Rx/Reactor) |
It does not work right now with |
Just to clarify - we should support |
...erator/src/main/kotlin/com/expediagroup/graphql/generator/types/utils/functionReturnTypes.kt
Show resolved
Hide resolved
…roup#342) * Allow data and errors to be returned with DataFetcherResult Fixes ExpediaGroup#244 Rebase of ExpediaGroup#245 Kotlin functions can now return a DataFetcherResult instead of just their return type which allows you to modify the errors field with any extra data you need * Move output type monad code into the generator * Move unwrapping logic back to function builder * Add unit test for publisher implementation
📝 Description
Kotlin functions can now return a DataFetcherResult instead of just their return type which allows you to modify the errors field with any extra data you need
Running the spring example with new function
🔗 Related Issues
Fixes #244
Rebase of #245