Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/FSharp.Data.GraphQL.Shared/Validation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ module Ast =
| _ when tref.Kind = TypeKind.NON_NULL -> checkIsCoercible tref.OfType.Value argName value
| IntValue _ ->
match tref.Name, tref.Kind with
| Some ("ID" | "Int" | "Float"), TypeKind.SCALAR -> Success
| Some ("ID" | "Int" | "Long" | "Float"), TypeKind.SCALAR -> Success
| _ -> canNotCoerce
| FloatValue _ ->
match tref.Name, tref.Kind with
Expand Down
10 changes: 10 additions & 0 deletions tests/FSharp.Data.GraphQL.Tests/AstValidationTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ let Arguments =
[ Define.Input ("intArg", Nullable IntType) ],
(fun ctx _ -> ctx.Arg ("intArg"))
)
Define.Field (
"longArgField",
Nullable LongType,
[ Define.Input ("longArg", Nullable LongType) ],
(fun ctx _ -> ctx.Arg ("longArg"))
)
Define.Field (
"nonNullBooleanListField",
ListOf BooleanType,
Expand Down Expand Up @@ -1020,6 +1026,10 @@ fragment coercedIntIntoFloatArg on Arguments {
floatArgField(floatArg: 123)
}

fragment coercedIntIntoLongArg on Arguments {
longArgField(longArg: 123)
}

query goodComplexDefaultValue($search: ComplexInput = { name: "Fido" }) {
findDog(complex: $search)
}"""
Expand Down
Loading