Here is how I added GraphQL support last week:
- Follow the hello world tutorial https://github.com/sourcegraph/sourcegraph-extension-docs/bl...
- Add logic to handle hovers and definitions https://github.com/sourcegraph/sourcegraph-graphql
- Write the server part https://github.com/chrismwendt/graphql-ws-langserver (once a browser-based GraphQL analysis library exists, this would be unnecessary because the analysis could be done entirely in the browser)
It's available at https://sourcegraph.com/extensions/chris/graphql and once you enable it you can test it out on a GraphQL file such as https://sourcegraph.com/github.com/chrismwendt/graphql-ws-la... (it's pretty slow/janky at the moment and could be improved, but works).
If you're interested in interfacing with other tools too, you might be interested in LSP (Language Server Protocol):
- https://langserver.org/
- https://microsoft.github.io/language-server-protocol/specifi...