Skip to content

Commit

Permalink
fix(torii/graphql): use borrowed_any instead of owned_any
Browse files Browse the repository at this point in the history
commit-id:eaaead2c
  • Loading branch information
lambda-0x committed Nov 14, 2024
1 parent ad073cc commit a8cea6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/torii/graphql/src/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub trait BasicObject: Send + Sync {
values
.edges
.iter()
.map(|v| FieldValue::owned_any(v.clone()))
.map(FieldValue::borrowed_any)
.collect::<Vec<FieldValue<'_>>>(),
)));
}
Expand All @@ -105,7 +105,7 @@ pub trait BasicObject: Send + Sync {
ctx.parent_value.try_downcast_ref::<ConnectionEdge<ErcTokenType>>()
{
match field_name.as_str() {
"node" => return Ok(Some(FieldValue::owned_any(values.node.clone()))),
"node" => return Ok(Some(FieldValue::borrowed_any(&values.node))),
"cursor" => {
return Ok(Some(FieldValue::value(Value::String(
values.cursor.clone(),
Expand All @@ -124,7 +124,7 @@ pub trait BasicObject: Send + Sync {
values
.edges
.iter()
.map(|v| FieldValue::owned_any(v.clone()))
.map(FieldValue::borrowed_any)
.collect::<Vec<FieldValue<'_>>>(),
)));
}
Expand All @@ -144,7 +144,7 @@ pub trait BasicObject: Send + Sync {
ctx.parent_value.try_downcast_ref::<ConnectionEdge<TokenTransferNode>>()
{
match field_name.as_str() {
"node" => return Ok(Some(FieldValue::owned_any(values.node.clone()))),
"node" => return Ok(Some(FieldValue::borrowed_any(&values.node))),
"cursor" => {
return Ok(Some(FieldValue::value(Value::String(
values.cursor.clone(),
Expand Down

0 comments on commit a8cea6f

Please sign in to comment.