[generator] filter lambda properties #1366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
Currently we don't support lambda parameters. Attempting to use a lambda property blows up with somewhat ambiguous messages (lambda return type is outside of supported packages/cannot calculate erasure type for suspendable lambda). Currently it was also not possible to filter out lambda properties using
@GraphQLIgnore
annotations as it was applied AFTER attempting to read lambda erasure type (which blows up as it cannot be calculated).This PR adds new property filter that checks whether property is a lambda and throws
InvalidPropertyReturnTypeException
if it is. Also moved@GraphQLIgnore
filter to be applied before we attempt to calculate JVM erasure (used to verify property type is not blacklisted).Throwing exception from a filter might not be ideal but IMHO is a better alternative than throwing current ambiguous exception (about JVM erasure) or by just filtering lambda parameters (which leads to questions of why my public property is not available in the graph).
🔗 Related Issues
Resolves #1364