-
Notifications
You must be signed in to change notification settings - Fork 21
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
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 --force from the command line. For older builds, please see the edit history of this comment. |
package.json
Outdated
"_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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
schemas/router_config_schema.json
Outdated
{ | ||
"$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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it, thanks!!
Following up on our discussion from last week.