-
Notifications
You must be signed in to change notification settings - Fork 99
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
fix: RecursiveTypeMapper returns exception which can't be handled by StandardServer #646
Conversation
…StandardServer RecursiveTypeMapper throws CannotMapTypeException when fails to find class by name. This exception goes through the GraphQl executor instead of catching and wrapping into ExecutionResult. Non wrapped exception does not trigger HttpCodeDecider. Schema test trust more to input than configuration which is not optimal, great possibility to improve configuration validation. Fixes: thecodingmachine#336
Thanks for this @fogrye. That skipped test - can we get that resolved? What's the issue with it? I'm not seeing where it's using a request in that test either. |
@oojacoboo it meant to fail when test query request entity which isn't presented because of bad config but after fix stoped. Now I see there only option for rewrite: check that with bad config (like not existing folder) nothing happens or new exception been thrown. |
Can we still use |
@oojacoboo unfortunately no, |
Why can't/shouldn't |
@oojacoboo I see the point in keeping everything clean and consistent but here is some problems:
Of course it's up to you to decide about such things as I'm newbie here but I would wish to clean up mappings a little including rethinking about how they trigger errors. Like, as an example, currently there is no way to throw error with reference to place in gql request because mapper which triggers them know nothing about which node it's processing. |
Good points @fogrye. Let's find a way to preserve that test. Maybe it makes sense to create a new Exception class for this scenario, then we can expect that Exception in that test commented out? I agree that some improvements could be made on the mappings. If you want to submit a PR that takes a shot at this, that'd certainly be appreciated. |
@fogrye just a reminder on this. It'd be nice to get this merged in before it gets stale. We need tests though. |
@oojacoboo had a busy time lately, will try to make it for tests soon. |
@fogrye thanks for this - couple small code style changes and I think it's ready to merge :) |
RecursiveTypeMapper throws CannotMapTypeException when fails to find class by name. This exception goes through the GraphQl executor instead of catching and wrapping into ExecutionResult. Non wrapped exception does not trigger HttpCodeDecider. Schema test trust more to input than configuration which is not optimal, great possibility to improve configuration validation.
Fixes: #336