Skip to content

Commit

Permalink
Revert "Allow rover dev to utilise watching again (#2065)"
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanrainer committed Aug 27, 2024
1 parent aa03a87 commit 3a74bd5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/command/dev/do_dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ impl Dev {
.unwrap_or(FederationVersion::LatestFedTwo),
client_config.clone(),
&self.opts.plugin_opts.profile,
false,
)
.await?;

Expand Down
1 change: 0 additions & 1 deletion src/command/supergraph/compose/do_compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ impl Compose {
&self.opts.federation_version.clone().unwrap_or(LatestFedTwo),
client_config.clone(),
&self.opts.plugin_opts.profile,
true,
)
.await?
// WARNING: remove this unwrap
Expand Down
23 changes: 4 additions & 19 deletions src/utils/supergraph_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ pub async fn get_supergraph_config(
federation_version: &FederationVersion,
client_config: StudioClientConfig,
profile_opt: &ProfileOpt,
create_static_config: bool,
) -> Result<Option<SupergraphConfig>, RoverError> {
// Read in Remote subgraphs
let remote_subgraphs = match graph_ref {
Expand All @@ -76,23 +75,11 @@ pub async fn get_supergraph_config(
}
None => None,
};

// Read in Local Supergraph Config
let supergraph_config = if let Some(file_descriptor) = &supergraph_config_path {
// Depending on the context we might want two slightly different kinds of SupergraphConfig.
if create_static_config {
// In this branch we get a completely resolved config, so all the references in it are
// resolved to a concrete SDL that could be printed out to a user. This is what
// `supergraph compose` uses.
Some(resolve_supergraph_yaml(file_descriptor, client_config, profile_opt).await?)
} else {
// Alternatively, we might actually want a more dynamic object so that we can
// set up watchers on the subgraph sources. This branch is what `rover dev` uses.
// So we run the `expand` function only to hydrate the YAML into a series of objects,
// but we don't need to completely resolve all of those objects.
let config = file_descriptor
.read_file_descriptor("supergraph config", &mut std::io::stdin())
.and_then(|contents| expand_supergraph_yaml(&contents))?;
Some(config)
}
eprintln!("resolving SDL for subgraphs defined in supergraph schema file",);
Some(resolve_supergraph_yaml(file_descriptor, client_config, profile_opt).await?)
} else {
None
};
Expand Down Expand Up @@ -343,7 +330,6 @@ mod test_get_supergraph_config {
latest_fed2_version,
studio_client_config,
&profile_opt,
true,
)
.await
.expect("Could not construct SupergraphConfig")
Expand All @@ -354,7 +340,6 @@ mod test_get_supergraph_config {
latest_fed2_version,
studio_client_config,
&profile_opt,
true,
)
.await
.expect("Could not construct SupergraphConfig")
Expand Down

0 comments on commit 3a74bd5

Please sign in to comment.