-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make enum as sealed class Unknown constructor opt-in (#5813)
* Make enum as sealed class Unknown constructor opt-in * Introduce ApolloEnumConstructor * Update libraries/apollo-annotations/src/commonMain/kotlin/com/apollographql/apollo3/annotations/ApolloEnumConstructor.kt Co-authored-by: Martin Bonnin <[email protected]> * Update libraries/apollo-annotations/src/commonMain/kotlin/com/apollographql/apollo3/annotations/ApolloEnumConstructor.kt Co-authored-by: Martin Bonnin <[email protected]> --------- Co-authored-by: Martin Bonnin <[email protected]>
- Loading branch information
1 parent
626f66f
commit cf6359f
Showing
5 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ions/src/commonMain/kotlin/com/apollographql/apollo3/annotations/ApolloEnumConstructor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.apollographql.apollo3.annotations | ||
|
||
@RequiresOptIn( | ||
level = RequiresOptIn.Level.WARNING, | ||
message = "The `UNKNOWN__` class represents GraphQL enums that are not present in the schema and whose `rawValue` cannot be checked at build time. You may want to update your schema instead of calling this constructor directly." | ||
) | ||
@Retention(AnnotationRetention.BINARY) | ||
@Target(AnnotationTarget.CONSTRUCTOR) | ||
annotation class ApolloEnumConstructor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
...ql/com/example/enums_as_sealed/kotlin/responseBased/enums_as_sealed/type/Enum.kt.expected
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.