Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions apollo-federation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub mod query_plan;
pub mod schema;
pub mod sources;
pub mod subgraph;
mod supergraph;
pub(crate) mod utils;

use apollo_compiler::ast::NamedType;
Expand All @@ -47,10 +48,10 @@ use crate::link::spec::Identity;
use crate::link::spec_definition::SpecDefinitions;
use crate::merge::merge_subgraphs;
use crate::merge::MergeFailure;
pub use crate::query_graph::extract_subgraphs_from_supergraph::ValidFederationSubgraph;
pub use crate::query_graph::extract_subgraphs_from_supergraph::ValidFederationSubgraphs;
use crate::schema::ValidFederationSchema;
use crate::subgraph::ValidSubgraph;
pub use crate::supergraph::ValidFederationSubgraph;
pub use crate::supergraph::ValidFederationSubgraphs;

pub(crate) type SupergraphSpecs = (&'static LinkSpecDefinition, &'static JoinSpecDefinition);

Expand Down Expand Up @@ -129,10 +130,7 @@ impl Supergraph {
}

pub fn extract_subgraphs(&self) -> Result<ValidFederationSubgraphs, FederationError> {
crate::query_graph::extract_subgraphs_from_supergraph::extract_subgraphs_from_supergraph(
&self.schema,
None,
)
supergraph::extract_subgraphs_from_supergraph(&self.schema, None)
}
}

Expand Down
2 changes: 1 addition & 1 deletion apollo-federation/src/query_graph/build_query_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::link::federation_spec_definition::KeyDirectiveArguments;
use crate::operation::merge_selection_sets;
use crate::operation::Selection;
use crate::operation::SelectionSet;
use crate::query_graph::extract_subgraphs_from_supergraph::extract_subgraphs_from_supergraph;
use crate::query_graph::QueryGraph;
use crate::query_graph::QueryGraphEdge;
use crate::query_graph::QueryGraphEdgeTransition;
Expand All @@ -41,6 +40,7 @@ use crate::schema::position::SchemaRootDefinitionPosition;
use crate::schema::position::TypeDefinitionPosition;
use crate::schema::position::UnionTypeDefinitionPosition;
use crate::schema::ValidFederationSchema;
use crate::supergraph::extract_subgraphs_from_supergraph;

/// Builds a "federated" query graph based on the provided supergraph and API schema.
///
Expand Down
1 change: 0 additions & 1 deletion apollo-federation/src/query_graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use crate::schema::ValidFederationSchema;

pub mod build_query_graph;
pub(crate) mod condition_resolver;
pub(crate) mod extract_subgraphs_from_supergraph;
pub(crate) mod graph_path;
pub mod output;
pub(crate) mod path_tree;
Expand Down
4 changes: 2 additions & 2 deletions apollo-federation/src/query_plan/fetch_dependency_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ use crate::operation::SelectionMap;
use crate::operation::SelectionSet;
use crate::operation::VariableCollector;
use crate::operation::TYPENAME_FIELD;
use crate::query_graph::extract_subgraphs_from_supergraph::FEDERATION_REPRESENTATIONS_ARGUMENTS_NAME;
use crate::query_graph::extract_subgraphs_from_supergraph::FEDERATION_REPRESENTATIONS_VAR_NAME;
use crate::query_graph::graph_path::concat_op_paths;
use crate::query_graph::graph_path::concat_paths_in_parents;
use crate::query_graph::graph_path::OpGraphPathContext;
Expand Down Expand Up @@ -74,6 +72,8 @@ use crate::schema::position::TypeDefinitionPosition;
use crate::schema::ValidFederationSchema;
use crate::subgraph::spec::ANY_SCALAR_NAME;
use crate::subgraph::spec::ENTITIES_QUERY;
use crate::supergraph::FEDERATION_REPRESENTATIONS_ARGUMENTS_NAME;
use crate::supergraph::FEDERATION_REPRESENTATIONS_VAR_NAME;
use crate::utils::logging::snapshot;

/// Represents the value of a `@defer(label:)` argument.
Expand Down
2 changes: 1 addition & 1 deletion apollo-federation/src/sources/connect/expand/carryover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ mod tests {

use super::carryover_directives;
use crate::merge::merge_federation_subgraphs;
use crate::query_graph::extract_subgraphs_from_supergraph::extract_subgraphs_from_supergraph;
use crate::schema::FederationSchema;
use crate::supergraph::extract_subgraphs_from_supergraph;

#[test]
fn test_carryover() {
Expand Down
2 changes: 1 addition & 1 deletion apollo-federation/src/sources/connect/expand/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ mod helpers {
use crate::error::FederationError;
use crate::link::spec::Identity;
use crate::link::Link;
use crate::query_graph::extract_subgraphs_from_supergraph::new_empty_fed_2_subgraph_schema;
use crate::schema::position::ObjectFieldDefinitionPosition;
use crate::schema::position::ObjectOrInterfaceTypeDefinitionPosition;
use crate::schema::position::ObjectTypeDefinitionPosition;
Expand All @@ -217,6 +216,7 @@ mod helpers {
use crate::subgraph::spec::EXTERNAL_DIRECTIVE_NAME;
use crate::subgraph::spec::KEY_DIRECTIVE_NAME;
use crate::subgraph::spec::REQUIRES_DIRECTIVE_NAME;
use crate::supergraph::new_empty_fed_2_subgraph_schema;
use crate::ValidFederationSubgraph;

/// A helper struct for expanding a subgraph into one per connect directive.
Expand Down
2 changes: 1 addition & 1 deletion apollo-federation/src/sources/connect/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ mod tests {
use insta::assert_debug_snapshot;

use super::*;
use crate::query_graph::extract_subgraphs_from_supergraph::extract_subgraphs_from_supergraph;
use crate::schema::FederationSchema;
use crate::supergraph::extract_subgraphs_from_supergraph;
use crate::ValidFederationSubgraphs;

static SIMPLE_SUPERGRAPH: &str = include_str!("./tests/schemas/simple.graphql");
Expand Down
2 changes: 1 addition & 1 deletion apollo-federation/src/sources/connect/spec/directives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ mod tests {
use apollo_compiler::name;
use apollo_compiler::Schema;

use crate::query_graph::extract_subgraphs_from_supergraph::extract_subgraphs_from_supergraph;
use crate::schema::FederationSchema;
use crate::sources::connect::spec::schema::SourceDirectiveArguments;
use crate::sources::connect::spec::schema::CONNECT_DIRECTIVE_NAME_IN_SPEC;
use crate::sources::connect::spec::schema::SOURCE_DIRECTIVE_NAME_IN_SPEC;
use crate::supergraph::extract_subgraphs_from_supergraph;
use crate::ValidFederationSubgraphs;

static SIMPLE_SUPERGRAPH: &str = include_str!("../tests/schemas/simple.graphql");
Expand Down
Loading