Skip to content

Conversation

sav007
Copy link
Contributor

@sav007 sav007 commented Oct 29, 2017

Problem: whenever server returns new unsupported by client enum value it's a breaking changes, as ResponseReader tries to map raw string value to appropriate generated enum constant by .valueOf.

Proposal: to have a fallback value called $UNKNOWN, so that any unsupported by client enum value is mapped to it. This will allow to handle such case gracefully.

Examples:

https://github.com/apollographql/apollo-android/pull/712/files#diff-9a0209432c8d9c39a92ea1e525dbee0d

https://github.com/apollographql/apollo-android/pull/712/files#diff-d88c16e23165a268eb39d908f34c5ab7

Problem: whenever server returns new unsupported by client enum value it's a breaking changes, as `ResponseReader` tries to map raw string value to appropriate generated enum constant by `.valueOf`.

Proposal: to have a fallback value called `$UNKNOWN`, so that any unsupported by client enum value is mapped to it. This will allow to handle such case gracefully.
@jeffreydecker
Copy link
Contributor

@sav007 thanks for getting this taken care of 😄 are there equivalent prs for the other platforms by any chance?

@sav007
Copy link
Contributor Author

sav007 commented Nov 1, 2017

@jeffreydecker we will sync tomorrow with iOS regarding this issue

@sav007 sav007 merged commit 6b378cf into apollographql:master Nov 1, 2017
@sav007 sav007 deleted the feature/enum-unknow-value branch November 1, 2017 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants