Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround CLI argument parsing issue #1096

Merged

Conversation

sfoulston
Copy link
Contributor

Due to an underlying issue with the Oclif framework that the Apollo CLI uses, the schema:download command (at least) fails when --header arguments are not placed at the end of the command, such as when specifying a non-default output path. The ApolloCodegenLib places the output path after the header argument, so the schema download always fails.

This PR just moves the header argument to the end of the bash command by reordering the array of arguments in ApolloSchemaOptions#arguments.

See also:
apollographql/apollo-tooling#844 (comment)

@sfoulston sfoulston closed this Mar 22, 2020
@sfoulston sfoulston deleted the fix/cli-argument-parsing branch March 22, 2020 16:49
@sfoulston sfoulston restored the fix/cli-argument-parsing branch March 22, 2020 17:03
@sfoulston
Copy link
Contributor Author

Re-opening PR, accidentally deleted branch.

@sfoulston sfoulston reopened this Mar 22, 2020
Copy link
Contributor

@designatednerd designatednerd left a comment

Choose a reason for hiding this comment

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

Good find! Just a couple minor things - if you're swamped let me know, I can merge and fix it in post

Tests/ApolloCodegenTests/ApolloSchemaTests.swift Outdated Show resolved Hide resolved
@designatednerd
Copy link
Contributor

@sfoulston D'oh! I merged your other PR and there's now a merge conflict - can you take a look at that when you have a chance? Otherwise this is good to go.

@sfoulston
Copy link
Contributor Author

No worries, just coincidence my two PRs touched the same bit of code! Have resolved & merged.

@designatednerd designatednerd added this to the Next Release milestone Mar 22, 2020
@designatednerd designatednerd merged commit 8252a57 into apollographql:master Mar 22, 2020
@sfoulston sfoulston deleted the fix/cli-argument-parsing branch March 25, 2020 14:38
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.

2 participants