apollo-workbench-vscode icon indicating copy to clipboard operation
apollo-workbench-vscode copied to clipboard

Apollo Workbench schemas should support subgraph linting

Open spurrkins opened this issue 3 years ago • 2 comments

It doesn't seem to be possible to lint a subgraph, which would be very helpful for fixing formatting after accumulating errors from copying schema bits around.

spurrkins avatar Sep 28 '21 22:09 spurrkins

@spurrkins I definitely agree with this but I've come up short on this in my first pass. One path I'm exploring is having workbench point at .graphql schema files that would be used instead of storing the schema in a giant file. This would enable local editor formatting rules to be applied, but that really primarily covers VS Code users. Two questions I have for you on this:

  1. Are you primarily a VS code user? I've been exploring the idea of separating some of this stuff out into a CLI that would make "Apollo Workbench" friendly outside of VS Code.
  2. How would you like to see your linting applied? Is this logic currently in subgraph repositories that already exists and you would like to "apply" that linting to a subgraph in workbench? Would you like to just use the schema in that repository directly instead?

michael-watson avatar Dec 29 '21 17:12 michael-watson

I do want to add linting in a future release. Currently you can run GraphOS schema checks that include linting results, but no way to "apply" the linting to fix the schema (or at least provide errors in the problems panel).

For formatting, I utilize the other Apollo VS Code Extension and it provides some formatting.

I'm going to keep this issue open, but this feature isn't currently planned.

michael-watson avatar Oct 13 '23 18:10 michael-watson