Skip to content

Commit

Permalink
generate_schema_resolvers -> ResolversSchemaModule
Browse files Browse the repository at this point in the history
Reviewed By: Snowshine-afk

Differential Revision: D51257562

fbshipit-source-id: 57b76e73824dede51a6993546f4a32f00300b3a9
  • Loading branch information
voideanvalue authored and facebook-github-bot committed Nov 14, 2023
1 parent 400090b commit 4f7739a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/crates/common/src/feature_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub struct FeatureFlags {

/// Fully build the schema resolvers artifact
#[serde(default)]
pub enable_schema_resolvers: bool,
pub generate_resolvers_schema_module: bool,

/// Enforce strict flavors for relay resolvers and disallow mixing flavors
#[serde(default)]
Expand Down
6 changes: 5 additions & 1 deletion compiler/crates/relay-codegen/src/build_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,11 @@ impl<'schema, 'builder, 'config> CodegenBuilder<'schema, 'builder, 'config> {
resolver_metadata: &RelayResolverMetadata,
inline_fragment: Option<Primitive>,
) -> Primitive {
if self.project_config.feature_flags.enable_schema_resolvers {
if self
.project_config
.feature_flags
.generate_resolvers_schema_module
{
self.build_normalization_relay_resolver_execution_time_for_worker(resolver_metadata)
} else if self
.project_config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub async fn transform_fixture(fixture: &Fixture<'_>) -> Result<String, String>
enable_resolver_normalization_ast: fixture
.content
.contains("# enable_resolver_normalization_ast"),
enable_schema_resolvers: false,
generate_resolvers_schema_module: false,
relay_resolvers_enable_strict_resolver_flavors: FeatureFlag::Disabled,
relay_resolvers_allow_legacy_verbose_syntax: FeatureFlag::Disabled,
enable_relay_resolver_mutations: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub async fn transform_fixture(fixture: &Fixture<'_>) -> Result<String, String>
relay_resolver_enable_output_type: FeatureFlag::Disabled,
relay_resolver_enable_interface_output_type: FeatureFlag::Disabled,
enable_resolver_normalization_ast: false,
enable_schema_resolvers: false,
generate_resolvers_schema_module: false,
relay_resolvers_enable_strict_resolver_flavors: FeatureFlag::Disabled,
relay_resolvers_allow_legacy_verbose_syntax: FeatureFlag::Disabled,
enable_relay_resolver_mutations: false,
Expand Down
5 changes: 4 additions & 1 deletion compiler/crates/relay-transforms/src/apply_transforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ fn apply_operation_transforms(
project_config.feature_flags.enable_relay_resolver_transform,
)
})?;
if project_config.feature_flags.enable_schema_resolvers {
if project_config
.feature_flags
.generate_resolvers_schema_module
{
program = log_event.time(
"generate_relay_resolvers_root_fragment_split_operation",
|| generate_relay_resolvers_root_fragment_split_operation(&program),
Expand Down

0 comments on commit 4f7739a

Please sign in to comment.