Apollo-server: INTERNAL_SERVER_ERROR is thrown when mutation variables are of invalid type

Created on 2 Oct 2019  路  4Comments  路  Source: apollographql/apollo-server

I guess this issue is related to #1410 and #2204.

The problem occurs in the package apollo-server at version 2.8.2.

An error being thrown inside the scalar evaluation code is being treated like an INTERNAL_SERVER_ERROR, when in fact it should be treated like a GRAPHQL_VALIDATION_FAILED or something like that. This issue occurs when dealing with variables in the graphql query/mutation. Somehow, the value of the variable manages to pass through schema validation and ends up causing trouble further up.

Here is a reproduction on CodeSandbox

Although my code is a little bit more complex than the example I cooked up in CodeSandbox, I think it shows the nature of the problem.

I really hope this get solved.

Thank you guys, you're awesome!

error-handling

Most helpful comment

Had the same issue here, did you found any solutions?

Thanks!!

All 4 comments

Had the same issue here, did you found any solutions?

Thanks!!

Duplicate of #3498

I've released a prerelease with this fix, version 2.23.0-alpha.0. Try out the alpha and see if it works for you! Please provide any feedback in #5094.

This is released in Apollo Server 2.23.0.

Was this page helpful?
0 / 5 - 0 ratings