Skip to content

Commit d9dfae6

Browse files
Upgrade bigdecimal crate 0.4 version (#1176)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kai Ren <[email protected]>
1 parent d7dcb3b commit d9dfae6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

juniper/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ All user visible changes to `juniper` crate will be documented in this file. Thi
2323
- Upgraded [`bson` crate] integration to [2.0 version](https://github.com/mongodb/bson-rust/releases/tag/v2.0.0). ([#979])
2424
- Upgraded [`uuid` crate] integration to [1.0 version](https://github.com/uuid-rs/uuid/releases/tag/1.0.0). ([#1057])
2525
- Upgraded [`chrono-tz` crate] integration to [0.8 version](https://github.com/chronotope/chrono-tz/blob/ea628d3131b4a659acb42dbac885cfd08a2e5de9/CHANGELOG.md#080). ([#1119])
26+
- Upgraded [`bigdecimal` crate] integration to 0.4 version. ([#1176])
2627
- Made `FromInputValue` trait methods fallible to allow post-validation. ([#987])
2728
- Redesigned `#[graphql_interface]` macro: ([#1009])
2829
- Removed support for `dyn` attribute argument (interface values as trait objects).
@@ -119,6 +120,7 @@ All user visible changes to `juniper` crate will be documented in this file. Thi
119120
[#1138]: /../../issues/1138
120121
[#1145]: /../../pull/1145
121122
[#1147]: /../../pull/1147
123+
[#1176]: /../../pull/1176
122124
[ba1ed85b]: /../../commit/ba1ed85b3c3dd77fbae7baf6bc4e693321a94083
123125
[CVE-2022-31173]: /../../security/advisories/GHSA-4rx6-g5vg-5f3j
124126

@@ -132,6 +134,7 @@ See [old CHANGELOG](/../../blob/juniper-v0.15.9/juniper/CHANGELOG.md).
132134

133135

134136

137+
[`bigdecimal` crate]: https://docs.rs/bigdecimal
135138
[`bson` crate]: https://docs.rs/bson
136139
[`chrono` crate]: https://docs.rs/chrono
137140
[`chrono-tz` crate]: https://docs.rs/chrono-tz

juniper/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ uuid = ["dep:uuid"]
4848
[dependencies]
4949
anyhow = { version = "1.0.47", default-features = false, optional = true }
5050
async-trait = "0.1.39"
51-
bigdecimal = { version = "0.3", optional = true }
51+
bigdecimal = { version = "0.4", optional = true }
5252
bson = { version = "2.4", features = ["chrono-0_4"], optional = true }
5353
chrono = { version = "0.4.20", features = ["alloc"], default-features = false, optional = true }
5454
chrono-tz = { version = "0.8", default-features = false, optional = true }

juniper/src/integrations/bigdecimal.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ mod bigdecimal_scalar {
4242
if let Some(i) = v.as_int_value() {
4343
Ok(BigDecimal::from(i))
4444
} else if let Some(f) = v.as_float_value() {
45-
BigDecimal::try_from(f)
45+
// See akubera/bigdecimal-rs#103 for details:
46+
// https://github.com/akubera/bigdecimal-rs/issues/103
47+
BigDecimal::from_str(&f.to_string())
4648
.map_err(|e| format!("Failed to parse `BigDecimal` from `Float`: {e}"))
4749
} else {
4850
v.as_string_value()

0 commit comments

Comments
 (0)