Add ability to download schema to file#1108
Conversation
trevor-scheer
left a comment
There was a problem hiding this comment.
LGTM! Thanks for putting this together 😄
|
Hey thanks for putting this together! Any thoughts if this might get released soon? |
|
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 |
1d79eaa to
5704bfe
Compare
|
@alexpyoung @legopin |
|
@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? |
|
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 |
* 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)
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
localendpoints. Not registry downloads.TODO:
*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.