Skip to content

Commit 113a9d0

Browse files
committed
fix: parseLiteral for GraphQLFloat should also return double, not float
1 parent 2d8051b commit 113a9d0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/graphql/Scalars.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public Object parseValue(Object input) {
8989

9090
@Override
9191
public Object parseLiteral(Object input) {
92-
return ((FloatValue) input).getValue().floatValue();
92+
return ((FloatValue) input).getValue().doubleValue();
9393
}
9494
});
9595

src/test/groovy/graphql/ScalarsTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class ScalarsTest extends Specification {
104104

105105
where:
106106
literal | result
107-
new FloatValue(42.3) | 42.3f
107+
new FloatValue(42.3) | 42.3d
108108
}
109109

110110
@Unroll

0 commit comments

Comments
 (0)