You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
For the record, a possible solution is to use sealedClassesForEnumsMatching.set(listOf(".*")) (probably make it the default in v4) and have the UNKNOWN__(rawValue) constructor be annotated with an @OptIn annotation so that it's harder to call from user code.
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: