Skip to content

Fix multiple localSchemaFile bug#1529

Merged
JakeDawkins merged 2 commits intomasterfrom
jake/fix-flag
Sep 13, 2019
Merged

Fix multiple localSchemaFile bug#1529
JakeDawkins merged 2 commits intomasterfrom
jake/fix-flag

Conversation

@JakeDawkins
Copy link
Copy Markdown
Contributor

@JakeDawkins JakeDawkins commented Sep 13, 2019

Because of how oclif handles flags, it was possible to incorrectly parse a command with multiple --localSchemaFile flags like the following:

apollo client:codegen --target=swift --localSchemaFile=schema.graphql API.swift

This command would parse the last <output> argument as a schema and fail to parse. This is a bug that currently exists in oclif with how multiple: true flags are parsed.

oclif/oclif#190 (comment)

This PR changes flag parsing to only accept a single flag for localSchemaFile, allowing for a comma-separated-list of schema files like:

apollo client:codegen --target=swift --localSchemaFile=schema.graphql,schema2.graphql API.swift`

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

*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.

@JakeDawkins JakeDawkins merged commit 2600b22 into master Sep 13, 2019
@JakeDawkins JakeDawkins deleted the jake/fix-flag branch September 13, 2019 20:58
designatednerd referenced this pull request in apollographql/apollo-ios Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant