Skip to content

fix(graphql-language-service): wrap list input values in brackets on autocomplete#4356

Open
DukeDeSouth wants to merge 1 commit into
graphql:mainfrom
DukeDeSouth:fix/587-wrap-list-input-values
Open

fix(graphql-language-service): wrap list input values in brackets on autocomplete#4356
DukeDeSouth wants to merge 1 commit into
graphql:mainfrom
DukeDeSouth:fix/587-wrap-list-input-values

Conversation

@DukeDeSouth

@DukeDeSouth DukeDeSouth commented Jun 16, 2026

Copy link
Copy Markdown

Completing an enum or boolean value at a list-typed position (like [Episode]) inserts a bare JEDI, so you end up with values: JEDI instead of values: [JEDI] — issue #587. The online parser already unwraps one list level once the caret is inside the brackets, so I count the remaining list depth and add that many brackets; nested lists like [[Episode]] work too. Values typed inside an existing [ ], single non-list values, and variables are left as-is. Added tests across the different positions and nullability combos, plus a changeset.

Closes #587

@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b9aa9aa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
graphql-language-service Patch
codemirror-graphql Patch

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

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 16, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: DukeDeSouth / name: DukeDeSouth (b9aa9aa)

…autocomplete

Completing an enum or boolean value for a list-typed argument or input
field (e.g. `[Episode]`) inserted a bare `JEDI`, which isn't valid there.
The online parser already unwraps one list level once the caret is inside
a `[ ]`, so the remaining list depth tells us how many brackets to add —
this also covers nested lists like `[[Episode]]`. Values typed inside an
existing list literal, single (non-list) values and variables are left
untouched.

Closes graphql#587
@DukeDeSouth DukeDeSouth force-pushed the fix/587-wrap-list-input-values branch from 87ff796 to b9aa9aa Compare June 16, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrap auto-completed list input values with square brackets if required

1 participant