Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions compiler/crates/relay-config/src/typegen_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ pub struct TypegenConfig {
/// This option enables emitting es modules artifacts.
#[serde(default)]
pub eager_es_modules: bool,

/// This option controls which emitted files have sorted fields, fragment names,
/// and union members. It also controls whether unions with more than one element
/// are written with surrounding parentheses.
#[serde(default)]
pub sort_typegen_items: SortTypegenItemsConfig,
}

#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
Expand Down Expand Up @@ -139,3 +145,15 @@ impl FlowTypegenPhase {
}
}
}

#[derive(Debug, Serialize, Deserialize, Clone, Copy, Default)]
pub struct SortTypegenItemsConfig {
#[serde(default)]
pub rollout: Rollout,
}

impl SortTypegenItemsConfig {
pub fn should_sort(&self, rollout_key: StringKey) -> bool {
self.rollout.check(rollout_key.lookup())
}
}
Loading