diff --git a/crates/torii/graphql/src/object/event_message.rs b/crates/torii/graphql/src/object/event_message.rs index e093dfea68..e9ca83cb75 100644 --- a/crates/torii/graphql/src/object/event_message.rs +++ b/crates/torii/graphql/src/object/event_message.rs @@ -8,7 +8,7 @@ use sqlx::pool::PoolConnection; use sqlx::{Pool, Sqlite}; use tokio_stream::StreamExt; use torii_core::simple_broker::SimpleBroker; -use torii_core::types::Entity; +use torii_core::types::EventMessage; use super::inputs::keys_input::keys_argument; use super::{BasicObject, ResolvableObject, TypeMapping, ValueMapping}; @@ -67,7 +67,7 @@ impl ResolvableObject for EventMessageObject { fn subscriptions(&self) -> Option> { Some(vec![SubscriptionField::new( - "entityUpdated", + "eventMessageUpdated", TypeRef::named_nn(self.type_name()), |ctx| { SubscriptionFieldFuture::new(async move { @@ -77,7 +77,7 @@ impl ResolvableObject for EventMessageObject { }; // if id is None, then subscribe to all entities // if id is Some, then subscribe to only the entity with that id - Ok(SimpleBroker::::subscribe().filter_map(move |entity: Entity| { + Ok(SimpleBroker::::subscribe().filter_map(move |entity: EventMessage| { if id.is_none() || id == Some(entity.id.clone()) { Some(Ok(Value::Object(EventMessageObject::value_mapping(entity)))) } else { @@ -93,7 +93,7 @@ impl ResolvableObject for EventMessageObject { } impl EventMessageObject { - pub fn value_mapping(entity: Entity) -> ValueMapping { + pub fn value_mapping(entity: EventMessage) -> ValueMapping { let keys: Vec<&str> = entity.keys.split('/').filter(|&k| !k.is_empty()).collect(); IndexMap::from([ (Name::new("id"), Value::from(entity.id)),