Skip to content
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

Methods in coercing can throw RunTimeExceptions #3501

Open
lenin-jaganathan opened this issue Mar 5, 2024 · 3 comments
Open

Methods in coercing can throw RunTimeExceptions #3501

lenin-jaganathan opened this issue Mar 5, 2024 · 3 comments
Labels

Comments

@lenin-jaganathan
Copy link

Describe the bug
The method contracts of Coercing allows for only Coercing*Exceptions to be thrown out of them. But, when the implementations only implement the deprecated versions of the methods using the latest graphql-java, and invoke non-deprecated versions of the APIs with any null values, there is a possibility for AssertionExceptions to be thrown.

Is this an expected behavior? And is it allowed to throw such validation exceptions?

To Reproduce
Use any Scalar from https://github.com/graphql-java/graphql-java-extended-scalars and invoke the non-deprecated API's with null values.

@bbakerman
Copy link
Member

Can you tell me which methods this happens on.

I can see that graphql.scalar.GraphqlIntCoercing#valueToLiteral(java.lang.Object, graphql.GraphQLContext, java.util.Locale) will throw Asserts on not null and we can debate that but I could not see other methods doing this.

@lenin-jaganathan
Copy link
Author

I guess all the methods in Coercing does throw an AssertionExceptions.

Copy link

Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.

@github-actions github-actions bot added the Stale label May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@bbakerman @lenin-jaganathan and others