Skip to content

Allow Long scalar coercion from integer literals during AST input validation#571

Merged
xperiandri merged 2 commits into
devfrom
copilot/fix-longtype-support-issue
May 17, 2026
Merged

Allow Long scalar coercion from integer literals during AST input validation#571
xperiandri merged 2 commits into
devfrom
copilot/fix-longtype-support-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

Inline integer literals for LongType were being rejected in AST validation, even though runtime coercion supports Long. This caused valid mutations/input objects using Long fields (e.g. addressId: 1) to fail before execution.

  • Validation logic

    • Updated scalar matching for IntValue in Validation.fs to include Long alongside ID, Int, and Float.
    • This aligns AST literal validation with existing scalar coercion behavior.
  • Regression coverage

    • Extended AstValidationTests schema fixture with a longArgField(longArg: Long) argument path.
    • Added a passing validation case for integer-to-long coercion via inline literal.
| IntValue _ ->
    match tref.Name, tref.Kind with
    | Some ("ID" | "Int" | "Long" | "Float"), TypeKind.SCALAR -> Success
    | _ -> canNotCoerce

Copilot AI linked an issue May 17, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix bug in support for LongType in schema definition Allow Long scalar coercion from integer literals during AST input validation May 17, 2026
Copilot AI requested a review from xperiandri May 17, 2026 14:39
@xperiandri xperiandri marked this pull request as ready for review May 17, 2026 14:43
@xperiandri xperiandri merged commit 8fcdc11 into dev May 17, 2026
3 checks passed
@xperiandri xperiandri deleted the copilot/fix-longtype-support-issue branch May 17, 2026 15:11
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.

Bug in support for LongType?

2 participants