feat(graphql-language-service): support GraphQL 17 fragment arguments - #4462
Conversation
🦋 Changeset detectedLatest commit: a3088a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
trevor-scheer
left a comment
There was a problem hiding this comment.
@JoviDeCroock neat! I haven't taken a full pass yet but I'm hoping to get to it this week.
What are your thoughts on making this functionality opt-in, default false for now? Given it's still experimental, it'd be a bit misleading if the editor experience validated and suggested language constructs that aren't going to be supported by most servers.
Is it accurate that this feature still needs a champion or is the PR title dated? Definitely promising to see that there's action on it / support built in to v17.
graphql/graphql-spec#1224
|
Yes, I abandonned championing due to time constraints and admittedly not knowing how to progress anything smoothly nowadays 😅 not sure how yall do validation of optional stuff, because it depends on both server and client support. Which comes down to the capabilities specification which is still in progress. |
|
@JoviDeCroock I completely understand!
Can you help me understand the question? You're right, without a capabilities handshake it just needs to be manual and user-facing for now. I guess I'm just suggesting a way for users to explicitly opt-in to this experimental feature instead of having it always on. So, something like:
|
|
The feature gate made this PR scope explode a bit 😅 apologies... In a later stage we could automatically derive this from the endpoint-capabilities when this passes the spec |
|
@JoviDeCroock no worries, it was at my request so...thanks! I should be able to find time this week for a real review. |
trevor-scheer
left a comment
There was a problem hiding this comment.
Looks great overall!
|
Thanks @JoviDeCroock! |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## graphiql@5.4.0 ### Minor Changes - [#4462](#4462) [`1cb7eba`](1cb7eba) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Add opt-in GraphQL 17 fragment argument syntax support to parsing, validation, type information, autocomplete, hover, and editor integrations. Enable it with `experimentalFragmentArguments: true`; it defaults to `false` until server capabilities can advertise support. Also fix variable autocomplete to respect operation and fragment scope while including variables from operations that spread the current fragment. ### Patch Changes - Updated dependencies [[`65867b5`](65867b5), [`6d57aad`](6d57aad), [`1cb7eba`](1cb7eba)]: - @graphiql/react@0.39.0 - @graphiql/plugin-doc-explorer@0.4.4 - @graphiql/plugin-history@0.4.4 ## @graphiql/react@0.39.0 ### Minor Changes - [#4462](#4462) [`1cb7eba`](1cb7eba) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Add opt-in GraphQL 17 fragment argument syntax support to parsing, validation, type information, autocomplete, hover, and editor integrations. Enable it with `experimentalFragmentArguments: true`; it defaults to `false` until server capabilities can advertise support. Also fix variable autocomplete to respect operation and fragment scope while including variables from operations that spread the current fragment. ### Patch Changes - [#4468](#4468) [`65867b5`](65867b5) Thanks [@therealyo](https://github.com/therealyo)! - Keep the active tab selected when a tab to its right is closed. `closeTab` decremented `activeTabIndex` unconditionally, without comparing it to the index of the closed tab. Closing a tab positioned after the active one does not shift the active tab Closing the active tab, or a tab before it, is unchanged. - [#4476](#4476) [`6d57aad`](6d57aad) Thanks [@trevor-scheer](https://github.com/trevor-scheer)! - Fix an extra empty tab being created on reload. The `query`/`variables`/`headers` storage keys are only written on edit, so reloading a session that never touched the editors found no stored editor state matching any tab and pushed a new empty one. - Updated dependencies [[`d0a34f4`](d0a34f4), [`1cb7eba`](1cb7eba), [`296214d`](296214d)]: - graphql-language-service@5.7.0 - monaco-graphql@1.9.0 ## graphql-language-service@5.7.0 ### Minor Changes - [#4462](#4462) [`1cb7eba`](1cb7eba) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Add opt-in GraphQL 17 fragment argument syntax support to parsing, validation, type information, autocomplete, hover, and editor integrations. Enable it with `experimentalFragmentArguments: true`; it defaults to `false` until server capabilities can advertise support. Also fix variable autocomplete to respect operation and fragment scope while including variables from operations that spread the current fragment. ### Patch Changes - [#4466](#4466) [`d0a34f4`](d0a34f4) Thanks [@glen-84](https://github.com/glen-84)! - Anchor validation diagnostics at the highlighted node's own position, so the range for an unknown aliased field covers the field name rather than the alias, and the range for an unknown directive covers its name rather than starting at the `@`. - [#4356](#4356) [`296214d`](296214d) Thanks [@DukeDeSouth](https://github.com/DukeDeSouth)! - Wrap autocompleted list input values in square brackets When you complete an enum or boolean value for a list-typed argument or input field (e.g. `[Episode]`), the suggestion now inserts `[JEDI]` instead of a bare `JEDI`, which produced an invalid query. Values completed inside an existing list literal, and non-list values, are left as they were. ## graphql-language-service-server@2.15.0 ### Minor Changes - [#4462](#4462) [`1cb7eba`](1cb7eba) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Add opt-in GraphQL 17 fragment argument syntax support to parsing, validation, type information, autocomplete, hover, and editor integrations. Enable it with `experimentalFragmentArguments: true`; it defaults to `false` until server capabilities can advertise support. Also fix variable autocomplete to respect operation and fragment scope while including variables from operations that spread the current fragment. ### Patch Changes - Updated dependencies [[`d0a34f4`](d0a34f4), [`1cb7eba`](1cb7eba), [`296214d`](296214d)]: - graphql-language-service@5.7.0 ## monaco-graphql@1.9.0 ### Minor Changes - [#4462](#4462) [`1cb7eba`](1cb7eba) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Add opt-in GraphQL 17 fragment argument syntax support to parsing, validation, type information, autocomplete, hover, and editor integrations. Enable it with `experimentalFragmentArguments: true`; it defaults to `false` until server capabilities can advertise support. Also fix variable autocomplete to respect operation and fragment scope while including variables from operations that spread the current fragment. ### Patch Changes - Updated dependencies [[`d0a34f4`](d0a34f4), [`1cb7eba`](1cb7eba), [`296214d`](296214d)]: - graphql-language-service@5.7.0 ## cm6-graphql@0.2.2 ### Patch Changes - [#4462](#4462) [`1cb7eba`](1cb7eba) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Add opt-in GraphQL 17 fragment argument syntax support to parsing, validation, type information, autocomplete, hover, and editor integrations. Enable it with `experimentalFragmentArguments: true`; it defaults to `false` until server capabilities can advertise support. Also fix variable autocomplete to respect operation and fragment scope while including variables from operations that spread the current fragment. - Updated dependencies [[`d0a34f4`](d0a34f4), [`1cb7eba`](1cb7eba), [`296214d`](296214d)]: - graphql-language-service@5.7.0 ## codemirror-graphql@2.2.9 ### Patch Changes - [#4462](#4462) [`1cb7eba`](1cb7eba) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Add opt-in GraphQL 17 fragment argument syntax support to parsing, validation, type information, autocomplete, hover, and editor integrations. Enable it with `experimentalFragmentArguments: true`; it defaults to `false` until server capabilities can advertise support. Also fix variable autocomplete to respect operation and fragment scope while including variables from operations that spread the current fragment. - Updated dependencies [[`d0a34f4`](d0a34f4), [`1cb7eba`](1cb7eba), [`296214d`](296214d)]: - graphql-language-service@5.7.0 ## @graphiql/plugin-code-exporter@5.1.4 ### Patch Changes - Updated dependencies [[`65867b5`](65867b5), [`6d57aad`](6d57aad), [`1cb7eba`](1cb7eba)]: - @graphiql/react@0.39.0 ## @graphiql/plugin-doc-explorer@0.4.4 ### Patch Changes - Updated dependencies [[`65867b5`](65867b5), [`6d57aad`](6d57aad), [`1cb7eba`](1cb7eba)]: - @graphiql/react@0.39.0 ## @graphiql/plugin-explorer@5.1.5 ### Patch Changes - Updated dependencies [[`65867b5`](65867b5), [`6d57aad`](6d57aad), [`1cb7eba`](1cb7eba)]: - @graphiql/react@0.39.0 ## @graphiql/plugin-history@0.4.4 ### Patch Changes - Updated dependencies [[`65867b5`](65867b5), [`6d57aad`](6d57aad), [`1cb7eba`](1cb7eba)]: - @graphiql/react@0.39.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
@trevor-scheer Thank you so much for merging this, I hope this enables the next champion to finally get all of this over the line. You're a hero mate! |
Revives #3761 now that GraphQL.js 17 ships experimental fragment argument support.
What changed
experimentalFragmentArgumentsparser option across diagnostics, outlines, operation facts, fragment dependencies, document mode detection, and external fragments