-
Notifications
You must be signed in to change notification settings - Fork 660
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
Make it impossible to pass as input some type which was generated only to preserve forwards compatibility but was not meant to be used as input #5796
Comments
For the record, a possible solution is to use |
After some back and forth, in #5904 we ended up removing the |
Closing as this is available to try with the v4 betas. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better. |
Use case
For a schema which contains these
Apollo-kotlin generates this code for
SomeEnum
:This makes it possible in user code to try and pass to a mutation this:
This however will always fail on the backend validation since this entry is not part of the real schema, and there is nothing to map it to.
Describe the solution you'd like
The problem here is just that this is possible and the compiler is not warning us about trying to run something that would never work.
Optimally, this code should not compile in the first place.
If this turns out to be way too complicated, even a lint warning or something similar might be a good first step. But as of right now making this mistake is unfortunately something that can happen silently.
The text was updated successfully, but these errors were encountered: