add json schemas for supergraph.yaml#216
Conversation
|
You can download the latest build of the extension for this PR here: To install the extension, download the file, unzip it and install it in VS Code by selecting "Install from VSIX..." in the Extensions view. Alternatively, run code --install-extension vscode-apollo-0.0.0-build-1729249832.pr-216.commit-f344a9b.vsix --forcefrom the command line. For older builds, please see the edit history of this comment. |
| "_url": "https://github.com/apollographql/router-template/raw/main/.apollo/router_config_schema.json", | ||
| "url": "./schemas/router_config_schema.json" |
There was a problem hiding this comment.
I'm not sure if I should link to the schema on GitHub or a local copy here. Any thoughts @dylan-apollo?
| "_url": "https://github.com/apollographql/router-template/raw/main/.apollo/router_config_schema.json", | |
| "url": "./schemas/router_config_schema.json" | |
| "url": "https://github.com/apollographql/router-template/raw/main/.apollo/router_config_schema.json" |
There was a problem hiding this comment.
If you do a local schema, you should also set up Renovate to regenerate it when new router releases come out—which would mean releasing a new version of the extension every week or two with the latest.
Or, I suppose, if we're keeping it up to date, we could also point the URL to this repo instead of router-template?
There was a problem hiding this comment.
We'll already have releases trickling in other places - Apollo Client release will trigger Apollo Devtools release, which will long-term trigger a release of the VSCode Devtools (or at least a PR).
I'm not too keep on doing that repeatedly with even more upstream sources, so I'd honestly rather point at another repo that is kept kinda up-to-date.
There was a problem hiding this comment.
Oh, we could also consider publishing to https://www.schemastore.org/json/ and linking to that?
See https://github.com/SchemaStore/schemastore/blob/master/CONTRIBUTING.md
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "title": "Configuration", | ||
| "description": "The configuration for the router.\n\nCan be created through `serde::Deserialize` from various formats, or inline in Rust code with `serde_json::json!` and `serde_json::from_value`.", |
There was a problem hiding this comment.
Yeah, this is something we should run by the router team. The point of this schema is to get editor support, so we should be updating our internal docs to be more useful for external consumers
|
Something I didn't consider, that we should test, is how this works with unstable router features. We have new config for Router 2.0, I wonder if that shows up as an error, with this change 😐 |
Two strategies come to mind:
|
|
@jerelmiller can we keep/merge the supergraph schema one (which pretty much never changes and should be safe) and just take out the Router config stuff for now? I don't think I'll have time to fix the red squigglies on connectors features before we want this released. |
|
@dylan-apollo I've reduced the scope to |
dylan-apollo
left a comment
There was a problem hiding this comment.
Let's do it, thanks!!

Following up on our discussion from last week.