-
Notifications
You must be signed in to change notification settings - Fork 2k
Throwing errors from parseLiteral #910
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
Comments
Just ran into this in apollographql/apollo-server#381. |
Definitely not intended as far as I can tell, considering the purpose of the refactor was to ensure that "internal errors throw and GraphQL user errors are returned within the GraphQL Result" – in this case, the purpose of throwing from a custom scalar type is to inform the user that they've provided invalid input. I noticed this because it's making a couple of my graphbrainz specs fail. /cc @leebyron |
+1 Getting "Internal Server Error" when throwing an error inside of |
Any news on this? |
Validate should always return safely and not throw. Is this still an issue? In the future please escalate by submitting a PR with a failing test case or better yet a fix. |
Fixes #910 This factors out the enum value validation from scalar value validation and ensures the same try/catch is used in isValidLiteralValue as isValidJSValue and protecting from errors in valueFromAST.
Fixes #910 This factors out the enum value validation from scalar value validation and ensures the same try/catch is used in isValidLiteralValue as isValidJSValue and protecting from errors in valueFromAST.
Fixes #910 This factors out the enum value validation from scalar value validation and ensures the same try/catch is used in isValidLiteralValue as isValidJSValue and protecting from errors in valueFromAST.
After 0.10.1 throwing
GraphQLError
fromparseLiteral
function in a custom scalar type leads to unhandled promise rejection. Tracked it down to this commit: 62619df#diff-e896d5930c71857fc9566b22defba666Parsing has a try-catch block around it, but validation does not. Doesn't seem like it was intended, considering it says "refactor".
The text was updated successfully, but these errors were encountered: