-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Don't swallow all errors in graphql function #28
Comments
Yeah this would be useful. Maybe a dev flag which could be passed to the |
Yeah, I feel this pain as well. I have a broader error handling refactor I need to do that should help this be less painful |
👍 Really hard to debug ATM. |
+1 on this. |
This is killing me. |
in
to the JSON returned and it has helped tremendously. |
+1 for this Thanks for the tip, @johanatan! Lifesaver! |
+1 good call johanastan |
Now that #118 has been merged; what's the next step forward here? graphql/express-graphql#4 is closed but to my knowledge this issue is not resolved. How can we help? |
+1 |
Has anybody patched this with #28 (comment) via @johanatan? |
+1, also, @johanatan, thanks a lot. I've already made a statue from you |
+1 |
This seems to be fixed here: https://github.com/graphql/express-graphql/pull/45/files
|
Closing this since graphql-js no longer formats Errors anymore (the Formatting is still recommended when using over a web endpoint, and |
Using import {
graphql,
} from 'graphql';
...
let resp = (await graphql(Schema, query, {}, context)); |
I have currently the same problem. I'm not quite sure how to test my custom error messages. Or is it better to test the whole express-graphql endpoint for the error messages? |
Agreed, how do we get a stack trace for the errors reported from using the |
Just stumbled upon this issue and not quite sure why is it closed. I only get the error title when invoking with |
@bkoltai @alfaproject You can access original errors and their stack traces, like that: const result = await execute(/* ... */);
if (result.errors) {
result.errors.forEach(err => console.log(err.originalError));
// ...
} |
There seems to be no way to get errors out of
graphql
function and one only gets error title, which can be the dreadedundefined is not a function
deep inside schema or resolve. Would be nice if there'd be a flag to let errors pass through fromgraphql
function, when they are not validation errors. I'd be willing to implement it if this change makes sense.Thanks!
The text was updated successfully, but these errors were encountered: