Skip to content

Add ability to download schema to file#1108

Merged
JakeDawkins merged 5 commits intomasterfrom
jake/client-download-schema
May 7, 2019
Merged

Add ability to download schema to file#1108
JakeDawkins merged 5 commits intomasterfrom
jake/client-download-schema

Conversation

@JakeDawkins
Copy link
Copy Markdown
Contributor

@JakeDawkins JakeDawkins commented Mar 12, 2019

Client projects could already download a schema from engine or an endpoint for codegen. This just exposes a command to download a schema to an output file, rather than just keeping it in memory.

I also updated the description for the service:download command and added an error to be more explicit that service:download is supposed to be used for local endpoints. Not registry downloads.

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.

Screen Shot 2019-03-12 at 3 38 21 PM

Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for putting this together 😄

Comment thread packages/apollo/src/commands/service/download.ts Outdated
@alexpyoung
Copy link
Copy Markdown

Hey thanks for putting this together! Any thoughts if this might get released soon?

@legopin
Copy link
Copy Markdown

legopin commented May 2, 2019

Would it be possible to release the client download feature first while we deliberate on the service:download command?

It would be very helpful to aid in collaboration among frontend and backend devs for new features

@JakeDawkins JakeDawkins force-pushed the jake/client-download-schema branch from 1d79eaa to 5704bfe Compare May 7, 2019 13:13
@JakeDawkins JakeDawkins merged commit dfeab7c into master May 7, 2019
@JakeDawkins JakeDawkins deleted the jake/client-download-schema branch May 7, 2019 13:36
@JakeDawkins
Copy link
Copy Markdown
Contributor Author

@alexpyoung @legopin apollo@2.10.0 has this in it! Sorry for the extended delay :)

https://github.com/apollographql/apollo-tooling#apollo-clientdownload-schema-output

@legopin
Copy link
Copy Markdown

legopin commented May 8, 2019

@JakeDawkins thanks for providing this feature. I was confused by the name of the command, I want to confirm that this feature saves the introspection result of the schema instead of the schema in SDL form right? Is there a specific reason why one is favored over the other?

@JakeDawkins
Copy link
Copy Markdown
Contributor Author

Yep @legopin! This command saves the JSON encoded introspection result. We use this format because it's easier to consume by other tooling for things like codegen and more commonly fragment matchers in apollo-client. If needed, you could always generate sdl from this result, but most of the time, JSON is fine

trevor-scheer added a commit that referenced this pull request May 8, 2019
* chore(deps): pin dependency @types/glob to 7.1.1 (#1145)

* Add gql to default config in apollo-language-server (#1176)

Add .gql file extension do default config `includes` glob

Fixes #1128

* Improve language server performance (#1206)

Add caching and debouncing to hot code paths (changing documents)

* Publish

 - apollo-codegen-core@0.33.4
 - apollo-codegen-flow@0.33.4
 - apollo-codegen-scala@0.34.4
 - apollo-codegen-swift@0.33.4
 - apollo-codegen-typescript@0.33.4
 - apollo-language-server@1.7.0
 - apollo@2.9.0
 - vscode-apollo@1.6.4

* Update changelog for publish

* chore(deps): pin dependency @types/lodash.debounce to 4.0.6 (#1208)

* chore(deps): update dependency @babel/types (#1215)

* chore(deps): update dependency @types/node-fetch to v2.3.3 (#1216)

* chore(deps): update dependency @babel/generator to v7.4.4 (#1217)

* chore(deps): update dependency typescript to v3.4.5 (#1220)

* chore(deps): update dependency @types/node to v8.10.47 (#1218)

* chore(deps): update dependency lerna to v3.13.4 (#1219)

* Update deprecated field usage (#1209)

* Update deprecated field usage

* Strongly type testing fixture to tie it to the shape of the result as the schema changes

* chore(deps): update dependency husky to v2 (#1222)

* chore(deps): update dependency @types/listr to v0.14.0 (#1234)

* chore(deps): update dependency husky to v2.2.0 (#1229)

* chore(deps): update dependency @types/jest to v24.0.12 (#1227)

* chore(deps): update dependency @types/node to v8.10.48 (#1228)

* chore(deps): update dependency lint-staged to v8.1.6 (#1230)

* chore(deps): update dependency symlink-dir to v3.0.3 (#1235)

* chore(deps): update dependency jest-environment-node to v24.8.0 (#1236)

* chore(deps): update dependency jest-matcher-utils to v24.8.0 (#1233)

* Add ability to download schema to file (#1108)

* Add ability to download schema for clients using the `download-schema` command
* use chalk for better error messaging

* Publish

 - apollo-codegen-core@0.33.5
 - apollo-codegen-flow@0.33.5
 - apollo-codegen-scala@0.34.5
 - apollo-codegen-swift@0.33.5
 - apollo-codegen-typescript@0.33.5
 - apollo-language-server@1.7.1
 - apollo@2.10.0
 - vscode-apollo@1.6.5

* Update changelog for 2.10.0 release

* chore(deps): update dependency dotenv to v8 (#1237)

* Update README.md (#1242)

* Add service:push debuggability (#1244)

Leverage oclif debug logger to add visibility into variables
sent to Engine during service:push.

* Publish

 - apollo-codegen-core@0.33.6
 - apollo-codegen-flow@0.33.6
 - apollo-codegen-scala@0.34.6
 - apollo-codegen-swift@0.33.6
 - apollo-codegen-typescript@0.33.6
 - apollo-language-server@1.7.2
 - apollo@2.10.1
 - vscode-apollo@1.6.6

* Update changelog for publish

* Debug log before the call out to Engine (#1245)

* Publish

 - apollo@2.10.2

* chore(deps): update dependency apollo-datasource to ^0.4.0 (#1246)
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.

4 participants