Skip to content

Commit 56c535f

Browse files
Refactor
1 parent 541b7e5 commit 56c535f

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

processed_data/src/graphql/entities.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl DataProcessing {
234234

235235
/// Datasets subgraph extension
236236
#[derive(SimpleObject)]
237-
#[graphql(name = "Datasets", complex)]
237+
#[graphql(name = "DataCollection", complex)]
238238
pub struct DataCollection {
239239
/// An opaque unique identifier for the data collection
240240
pub id: u32,

processed_data/src/graphql/mod.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ impl Loader<u32> for AutoProcessingDataLoader {
213213
type Value = Vec<AutoProcessing>;
214214
type Error = async_graphql::Error;
215215

216-
#[instrument(name = "load_auto_proc_integration", skip(self))]
216+
#[instrument(name = "load_auto_processing", skip(self))]
217217
async fn load(&self, keys: &[u32]) -> Result<HashMap<u32, Self::Value>, Self::Error> {
218-
let span = tracing::info_span!(parent: &self.parent_span, "load_auto_proc_integration");
218+
let span = tracing::info_span!(parent: &self.parent_span, "load_auto_processing");
219219
let _span = span.enter();
220220
let mut results = HashMap::new();
221221
let keys_vec: Vec<u32> = keys.to_vec();
@@ -396,10 +396,8 @@ impl AutoProcessing {
396396
) -> async_graphql::Result<Option<AutoProcScalingStatics>> {
397397
let loader = ctx.data_unchecked::<DataLoader<AutoProcScalingDataLoader>>();
398398
match self.auto_proc_id {
399-
Some(id) => loader
400-
.load_one((id, StatisticsType::Overall))
401-
.await,
402-
None => Ok(None)
399+
Some(id) => loader.load_one((id, StatisticsType::Overall)).await,
400+
None => Ok(None),
403401
}
404402
}
405403

@@ -410,12 +408,9 @@ impl AutoProcessing {
410408
) -> async_graphql::Result<Option<AutoProcScalingStatics>> {
411409
let loader = ctx.data_unchecked::<DataLoader<AutoProcScalingDataLoader>>();
412410
match self.auto_proc_id {
413-
Some(id) => loader
414-
.load_one((id, StatisticsType::InnerShell))
415-
.await,
416-
None => Ok(None)
411+
Some(id) => loader.load_one((id, StatisticsType::InnerShell)).await,
412+
None => Ok(None),
417413
}
418-
419414
}
420415

421416
/// Fetches the outershell scaling statistics type
@@ -425,10 +420,8 @@ impl AutoProcessing {
425420
) -> async_graphql::Result<Option<AutoProcScalingStatics>> {
426421
let loader = ctx.data_unchecked::<DataLoader<AutoProcScalingDataLoader>>();
427422
match self.auto_proc_id {
428-
Some(id) => loader
429-
.load_one((id, StatisticsType::OuterShell))
430-
.await,
431-
None => Ok(None)
423+
Some(id) => loader.load_one((id, StatisticsType::OuterShell)).await,
424+
None => Ok(None),
432425
}
433426
}
434427
}

0 commit comments

Comments
 (0)