Skip to content

Add sdl download ability to client:download-schema#1470

Merged
JakeDawkins merged 16 commits intoapollographql:masterfrom
essaji:feature/issue-1408
Oct 23, 2019
Merged

Add sdl download ability to client:download-schema#1470
JakeDawkins merged 16 commits intoapollographql:masterfrom
essaji:feature/issue-1408

Conversation

@essaji
Copy link
Copy Markdown
Contributor

@essaji essaji commented Aug 14, 2019

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

Using one of followings:

  • client:download-schema filename.graphql
  • client:download-schema filename.graphqls
  • client:download-schema filename.gql

will download graphql schema in SDL format

Related issue: #1408

@apollo-cla
Copy link
Copy Markdown

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

@essaji essaji force-pushed the feature/issue-1408 branch 4 times, most recently from c3108d0 to 7315794 Compare August 15, 2019 09:21
@essaji essaji marked this pull request as ready for review August 15, 2019 09:42
@essaji essaji force-pushed the feature/issue-1408 branch from 7315794 to 0a7c718 Compare August 15, 2019 09:43
@essaji essaji closed this Aug 15, 2019
@essaji essaji reopened this Aug 15, 2019
@essaji essaji changed the title feature/issue-1408 - Added --target flag for download-schema command client:download-schema - Add --target flag to download schema in desired format Aug 17, 2019
Comment thread packages/apollo/src/commands/client/download-schema.ts Outdated
@essaji essaji force-pushed the feature/issue-1408 branch from 1b0f62f to 75476ab Compare August 18, 2019 09:21
@FabHof
Copy link
Copy Markdown

FabHof commented Aug 20, 2019

I was just wondering why this is not possible. Can we get a release with this soon?

Comment thread packages/apollo/README.md Outdated
Comment thread packages/apollo/src/commands/client/download-schema.ts Outdated
@essaji
Copy link
Copy Markdown
Contributor Author

essaji commented Aug 20, 2019

@jgzuke client:codegen › writes types for typescript with a custom extension test is failing in my PR. Do we need to re-trigger the build?

@nhusher
Copy link
Copy Markdown

nhusher commented Sep 24, 2019

Is there anything blocking this being merged? It will make some of my team's development tooling much simpler.

@JakeDawkins
Copy link
Copy Markdown
Contributor

I know this wasn't discussed in the original issue, but why not use the file extension to determine what format to save in?

I think the output could be something like my-types.graphql and it could recognize the file extension and know the output format is SDL. I think we could also allow for .gql, .graphqls for sdl formatting

Also, editing the readme directly doesn't work, you need to edit the flag descriptions in the source. That section of the readme is generated :)

@JakeDawkins JakeDawkins added 🔨 cli related to the CLI itself 🎉 feature New addition or enhancement to existing solutions labels Oct 22, 2019
@JakeDawkins JakeDawkins changed the title client:download-schema - Add --target flag to download schema in desired format Add sdl download ability to client:download-schema Oct 22, 2019
@essaji
Copy link
Copy Markdown
Contributor Author

essaji commented Oct 22, 2019

@JakeDawkins that was a good idea, I have updated the code accordingly. And yeah I was wondering why updating readme file was causing to break the tests 😄 thanks for letting me know.

@JakeDawkins
Copy link
Copy Markdown
Contributor

nice! One last change, and this should be good to go! Can you change the description of the output arg to mention the filetypes, like

Path to write the introspection result to. Can be `.graphql`, `.gql`, `.graphqls`, or `.json`

@essaji
Copy link
Copy Markdown
Contributor Author

essaji commented Oct 23, 2019

@JakeDawkins Description updated

@JakeDawkins JakeDawkins merged commit fe4d46c into apollographql:master Oct 23, 2019
@JakeDawkins
Copy link
Copy Markdown
Contributor

Woo! Thanks @essaji :) I'll get this out in the next release in the next day or two!

@essaji essaji deleted the feature/issue-1408 branch October 23, 2019 13:32
@bkniffler
Copy link
Copy Markdown

Its been a few weeks now, is there any info when we can expect this to be published? Thanks :)

@JakeDawkins
Copy link
Copy Markdown
Contributor

This should be released with apollo@2.21.1! Let me know if there are any issues! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 cli related to the CLI itself 🎉 feature New addition or enhancement to existing solutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants