Skip to content
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

Validate graphql-config using vscode-graphql and the available schema json #2606

Open
acao opened this issue Jul 30, 2022 · 6 comments
Open

Comments

@acao
Copy link
Member

acao commented Jul 30, 2022

This is just a few lines of code!

https://raw.githubusercontent.com/kamilkisiela/graphql-config/master/config-schema.json
https://code.visualstudio.com/Docs/languages/json#_mapping-a-schema-in-an-extension

I feel like if I write anything more about it, I'll officially have had spent more time planning this than implementing it as usual 😆

@acao
Copy link
Member Author

acao commented Aug 1, 2022

CC @dotansimha , @dotansimha and @kamilkisiela! this is a quick easy win I have planned, just so it's on your radar

@kamilkisiela
Copy link

CC @dotansimha and @dotansimha

@acao
Copy link
Member Author

acao commented Aug 1, 2022

I was thinking of even suggesting it as a standalone extension. Then folks can use it without vscode-graphql, and say with the standalone vscode syntax extension we just released, and graphql-eslint, whatever works for folks! 🤷🏻‍♀️

@acao
Copy link
Member Author

acao commented Aug 1, 2022

CC @B2o5T as well of course haha!

@acao
Copy link
Member Author

acao commented Aug 1, 2022

perhaps there could be a thin client to a say, GraphQL.graphql-config extension, (or if you want to publish it yourselves and we can depend on it), where we do a bit of user-driven validation messaging as well perhaps?

as you may know, we have a graphql-config namespace in settings already staked out for you for vscode haha! there is graphql-config.load.baseDir and legacy and other parameters for loadConfig, and other settings iirc

another thing to consider is that we have extensions that want to load graphql for query exection/etc, and many more in userland who are looking to load graphql-config, so we could make a shared interface for that that wraps loadConfig with logic for common vscode extension client validation notifications/etc that you only see once no matter how many of these extensions that use the graphql-config vscode extensions you are running

@acao
Copy link
Member Author

acao commented Aug 2, 2022

also noting this is only for .json, but here is one lead for .yaml:

https://github.com/redhat-developer/vscode-yaml#extension-settings

there are ways we could also just handle actual graphql-config validation messages as notifications on editor or save regardless of the format. to use graphql-config, itself, then errors would need to come back with positional metadata for where the error occurred in the file

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

No branches or pull requests

2 participants