Skip to content

Fix parseLiteral not called on per-schema scalar overrides for inline arguments#1880

Merged
spawnia merged 4 commits intomasterfrom
fix-parse-literal
Mar 23, 2026
Merged

Fix parseLiteral not called on per-schema scalar overrides for inline arguments#1880
spawnia merged 4 commits intomasterfrom
fix-parse-literal

Conversation

@ruudk
Copy link
Collaborator

@ruudk ruudk commented Mar 17, 2026

AST::valueFromAST() called parseLiteral() on the built-in scalar singleton from field definitions, not the custom override registered via the type loader. This meant inline literal arguments like node(id: 123) silently skipped custom parsing logic.

Pass the Schema into valueFromAST() and resolve built-in scalars from it before calling parseLiteral(), mirroring the parseValue() fix in Values::coerceInputValue().

Also thread the schema through getDirectiveValues() so directive arguments (e.g. @include(if: true)) use schema-resolved scalars too.

Extract Type::isBuiltInScalarName() to centralize the name check without requiring an instanceof guard.

Related to #1869

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants