Skip to content

Commit 1355a26

Browse files
committed
get rid of field queue
1 parent c2f9d2f commit 1355a26

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

crates/isograph_compiler/src/watch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use notify_debouncer_full::{
1111
};
1212
use std::{path::PathBuf, time::Duration};
1313
use tokio::{runtime::Handle, sync::mpsc::Receiver};
14-
use tracing::info;
14+
use tracing::{info, warn};
1515

1616
use crate::{
1717
batch_compile::{BatchCompileError, compile, print_result},
@@ -251,7 +251,7 @@ pub fn create_debounced_file_watcher(
251251
let sender = sender.clone();
252252
current_runtime.spawn(async move {
253253
if let Err(e) = sender.send(events).await {
254-
println!("Error sending event result: {e:?}");
254+
warn!("Error sending event result: {e:?}");
255255
}
256256
});
257257
}

crates/isograph_schema/src/memoized/client_selectable_access.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,10 @@ pub fn expose_field_map<TNetworkProtocol: NetworkProtocol>(
369369
>,
370370
MemoizedIsoLiteralError<TNetworkProtocol>,
371371
> {
372-
let expose_as_field_queue = create_type_system_schema_with_server_selectables(db)
373-
.as_ref()
374-
.map_err(|e| e.clone())?;
372+
let (expose_as_field_queue, _field_queue) =
373+
create_type_system_schema_with_server_selectables(db)
374+
.as_ref()
375+
.map_err(|e| e.clone())?;
375376

376377
let mut map = HashMap::new();
377378
for (parent_object_entity_name, expose_as_fields_to_insert) in expose_as_field_queue {

crates/isograph_schema/src/validated_isograph_schema/create_type_system_schema.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
11
use std::collections::HashMap;
22

33
use crate::{
4-
CreateAdditionalFieldsError, ExposeFieldToInsert, FieldToInsertToServerSelectableError,
5-
IsographDatabase, NetworkProtocol,
4+
CreateAdditionalFieldsError, ExposeFieldToInsert, FieldToInsert,
5+
FieldToInsertToServerSelectableError, IsographDatabase, NetworkProtocol,
66
};
7-
use common_lang_types::{SelectableName, ServerObjectEntityName};
7+
use common_lang_types::{SelectableName, ServerObjectEntityName, WithLocation};
88
use pico_macros::memo;
99
use thiserror::Error;
1010

1111
#[memo]
12+
#[expect(clippy::type_complexity)]
1213
pub fn create_type_system_schema_with_server_selectables<TNetworkProtocol: NetworkProtocol>(
1314
db: &IsographDatabase<TNetworkProtocol>,
1415
) -> Result<
15-
HashMap<ServerObjectEntityName, Vec<ExposeFieldToInsert>>,
16+
(
17+
HashMap<ServerObjectEntityName, Vec<ExposeFieldToInsert>>,
18+
HashMap<ServerObjectEntityName, Vec<WithLocation<FieldToInsert>>>,
19+
),
1620
CreateSchemaError<TNetworkProtocol>,
1721
> {
1822
let (items, _fetchable_types) = TNetworkProtocol::parse_type_system_documents(db)
1923
.as_ref()
2024
.map_err(|e| CreateSchemaError::ParseAndProcessTypeSystemDocument { message: e.clone() })?;
2125

26+
let mut field_queue = HashMap::new();
2227
let mut expose_as_field_queue = HashMap::new();
2328

2429
for item in items.iter().flat_map(|x| x.as_ref().as_object()) {
30+
field_queue.insert(
31+
item.server_object_entity.item.name.item,
32+
item.fields_to_insert.clone(),
33+
);
34+
2535
expose_as_field_queue.insert(
2636
item.server_object_entity.item.name.item,
2737
item.expose_fields_to_insert.clone(),
2838
);
2939
}
3040

31-
Ok(expose_as_field_queue)
41+
Ok((expose_as_field_queue, field_queue))
3242
}
3343

3444
#[derive(Error, Debug, PartialEq, Eq, Clone)]

crates/isograph_schema/src/validated_isograph_schema/get_validated_schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use thiserror::Error;
1515
pub fn get_validated_schema<TNetworkProtocol: NetworkProtocol>(
1616
db: &IsographDatabase<TNetworkProtocol>,
1717
) -> Result<ContainsIsoStats, GetValidatedSchemaError<TNetworkProtocol>> {
18-
let expose_as_field_queue = create_type_system_schema_with_server_selectables(db)
18+
let (expose_as_field_queue, _) = create_type_system_schema_with_server_selectables(db)
1919
.as_ref()
2020
.map_err(|e| e.clone())?;
2121

0 commit comments

Comments
 (0)