-
I'm trying to use rust_decimal as a type for my Cynic fragments, but I'm getting weird errors and no clue how to solve them. use rust_decimal::{serde, Decimal};
#[derive(cynic::QueryFragment, Debug)]
pub struct TransactionProcessAction {
pub amount: PositiveDecimal,
pub action_type: TransactionFlowStrategyEnum,
}
#[derive(cynic::Scalar, Debug, Clone)]
//originally pub struct PositiveDecimal(pub String);
pub struct PositiveDecimal(pub Decimal); This error shows on those derives: rust-analyzer: expected 0 arguments, found 1 [E0107]
rustc: this method takes 0 arguments but 1 argument was supplied
unexpected argument of type __S [E0061]
rustc: mismatched types
expected enum std::result::Result<<__S as app::_::_serde::Serializer>::Ok, <__S as app::_::_serde::Serializer>::Error>
found array [u8; 16] [E0308] And the same thing happens when I use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think this is a bug in cynic, caused by this serialize function on I'll fix, but in the meantime you can just do |
Beta Was this translation helpful? Give feedback.
-
Appreciate your hard work! Didn't even have time to look at this post since I posted and the bug is already solved, you're amazing <3 |
Beta Was this translation helpful? Give feedback.
Fixed in #909