Skip to content

graphql-language-service: Support single-item coercion for lists #4090

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AaronMoat
Copy link
Contributor

https://spec.graphql.org/draft/#sec-List.Input-Coercion:

If the value passed as an input to a list type is not a list and not the null value, then the result of input coercion is a list of size one, where the single item value is the result of input coercion for the list’s item type on the provided value (note this may apply recursively for nested lists).

This allows inputs which accept one or many arguments (sometimes referred to as “var args”) to declare their input type as a list while for the common case of a single value, a client can just pass that value directly rather than constructing the list.

Copy link

changeset-bot bot commented Aug 8, 2025

🦋 Changeset detected

Latest commit: 7b4bb82

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 Minor
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

Copy link

codecov bot commented Aug 8, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.02%. Comparing base (0d9e51a) to head (7b4bb82).

Files with missing lines Patch % Lines
...nguage-service/src/utils/getVariablesJSONSchema.ts 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4090      +/-   ##
==========================================
+ Coverage   63.96%   64.02%   +0.06%     
==========================================
  Files          35       35              
  Lines        3086     3083       -3     
  Branches      948      946       -2     
==========================================
  Hits         1974     1974              
+ Misses       1107     1104       -3     
  Partials        5        5              
Files with missing lines Coverage Δ
...nguage-service/src/utils/getVariablesJSONSchema.ts 1.62% <0.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants