Skip to content

Swift: Add flag to omit deprecated enum cases#1595

Merged
designatednerd merged 3 commits intoapollographql:masterfrom
kevinmbeaulieu:kb/omit-deprecated-enum-cases
Oct 18, 2019
Merged

Swift: Add flag to omit deprecated enum cases#1595
designatednerd merged 3 commits intoapollographql:masterfrom
kevinmbeaulieu:kb/omit-deprecated-enum-cases

Conversation

@kevinmbeaulieu
Copy link
Copy Markdown
Contributor

@kevinmbeaulieu kevinmbeaulieu commented Oct 17, 2019

Implement feature request described in apollographql/apollo-ios#840

TODO:

  • Update CHANGELOG.md* with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@apollo-cla
Copy link
Copy Markdown

@kevinmbeaulieu: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@designatednerd
Copy link
Copy Markdown
Contributor

Ignore the unrelated failures in the windows 10 one.

Can you add some tests for this please?

@kevinmbeaulieu
Copy link
Copy Markdown
Contributor Author

@designatednerd Added tests for both the enabled & disabled states of the new flag

Comment thread __fixtures__/starwars/schema.graphql
description: "The namespace to emit generated code into."
}),
omitDeprecatedEnumCases: flags.boolean({
description: "Omit deprecated enum cases from generated code [Swift only]"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this default to false to preserve existing behavior, or would that be overkill?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I intended for this to default to false to preserve existing behavior- is that not how it would behave as currently implemented? Looking at the implementation of flags.boolean I saw "specifying a default of false is the same not specifying a default"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok (not exactly a typescript expert over here). I think that should work fine, then.

@designatednerd designatednerd merged commit 6a5ae4b into apollographql:master Oct 18, 2019
@kevinmbeaulieu kevinmbeaulieu deleted the kb/omit-deprecated-enum-cases branch October 18, 2019 18:24
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