From 60c61a2e8d30051c9dcd434d87587ab9167d630e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=B6nke?= Date: Wed, 7 Jan 2026 12:04:31 +0000 Subject: [PATCH] Fix Box compatibility with sea-orm 2.0.0-rc Handle upstream sea-query change where Value::Json now uses Box instead of serde_json::Value directly. --- macros/src/convert_output.rs | 2 +- src/builder_context/types_map.rs | 2 +- src/outputs/entity_object.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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()), })