Skip to content

fix: check own properties when reading input object fields - #5013

Open
hoanle0126 wants to merge 1 commit into
graphql:17.x.xfrom
hoanle0126:fix/input-object-own-properties
Open

hoanle0126 wants to merge 1 commit into
graphql:17.x.xfrom
hoanle0126:fix/input-object-own-properties

Conversation

@hoanle0126

Copy link
Copy Markdown

Check Object.hasOwn before reading input object fields in coerceInputValue, validateInputValue, valueToLiteral, and astFromValue, and return early on @oneOf field-count mismatch so empty inputs do not read inherited undefined properties.

Previously these loops read properties directly from the input object, so omitting a field matching an inherited property (such as toString or constructor) or passing an object with a prototype getter could read the inherited value instead of treating the field as omitted. This aligns input-object field lookups with the own-property guards used for variable lookups in #4671 and #4983.

@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

@hoanle0126 is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

This branch has not been deployed

No deployments
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.

1 participant