diff --git a/macros/src/convert_output.rs b/macros/src/convert_output.rs index b748c49f..3564261f 100644 --- a/macros/src/convert_output.rs +++ b/macros/src/convert_output.rs @@ -77,7 +77,7 @@ fn derive_convert_output_enum_containers( ) -> async_graphql::Result>> { if let sea_orm::sea_query::value::Value::Json(opt_json) = value { if let Some(json) = opt_json { - match serde_json::from_value::<#orig_ident>(json.clone()) { + match serde_json::from_value::<#orig_ident>((*json).clone()) { Ok(obj) => match obj { #(#variant_matches)* }, diff --git a/src/builder_context/types_map.rs b/src/builder_context/types_map.rs index e8f58bee..33eab40e 100644 --- a/src/builder_context/types_map.rs +++ b/src/builder_context/types_map.rs @@ -660,7 +660,7 @@ pub fn converted_value_to_sea_orm_value( })?, Err(_) => value.deserialize()?, }; - sea_orm::Value::Json(Some(value)) + sea_orm::Value::Json(Some(Box::new(value))) } #[cfg(feature = "with-chrono")] ConvertedType::ChronoDate => { diff --git a/src/outputs/entity_object.rs b/src/outputs/entity_object.rs index dca74872..05fd3dce 100644 --- a/src/outputs/entity_object.rs +++ b/src/outputs/entity_object.rs @@ -282,7 +282,7 @@ pub(crate) fn sea_query_value_to_graphql_value( #[cfg(feature = "with-json")] #[cfg_attr(docsrs, doc(cfg(feature = "with-json")))] sea_orm::sea_query::Value::Json(value) => { - value.map(|it| match Value::from_json(it.clone()) { + value.map(|it| match Value::from_json((*it).clone()) { Ok(v) => v, Err(_) => Value::from(it.to_string()), })