File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' graphql-scalars ' : patch
3
+ ---
4
+
5
+ Fix BigInt handling
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export const GraphQLBigIntConfig: GraphQLScalarTypeConfig<
80
80
if ( inputValue . toString ( ) !== bigint . toString ( ) ) {
81
81
throw createGraphQLError ( `BigInt cannot represent value: ${ inputValue } ` ) ;
82
82
}
83
- if ( ! isSafeInteger ( bigint ) && ! isBigIntSerializable ( ) ) {
83
+ if ( isSafeInteger ( bigint ) && ! isBigIntSerializable ( ) ) {
84
84
return Number ( bigint . toString ( ) ) ;
85
85
}
86
86
return bigint ;
@@ -96,7 +96,7 @@ export const GraphQLBigIntConfig: GraphQLScalarTypeConfig<
96
96
if ( strOrBooleanValue . toString ( ) !== bigint . toString ( ) ) {
97
97
throw createGraphQLError ( `BigInt cannot represent value: ${ strOrBooleanValue } ` ) ;
98
98
}
99
- if ( ! isSafeInteger ( bigint ) && ! isBigIntSerializable ( ) ) {
99
+ if ( isSafeInteger ( bigint ) && ! isBigIntSerializable ( ) ) {
100
100
return Number ( bigint . toString ( ) ) ;
101
101
}
102
102
return bigint ;
You can’t perform that action at this time.
0 commit comments