export { queryPlanSerializer , astSerializer } from './snapshotSerializers' ; export { prettyFormatQueryPlan } from './prettyFormatQueryPlan' ; export * from './QueryPlan' ; import { QueryPlan } from './QueryPlan' ; import { Schema , Operation } from '@apollo/federation-internals' ; import { buildFederatedQueryGraph , QueryGraph } from "@apollo/query-graphs" ; import { computeQueryPlan } from './buildPlan' ; export class QueryPlanner { private readonly federatedQueryGraph : QueryGraph ; constructor ( public readonly supergraphSchema ) { this . federatedQueryGraph = buildFederatedQueryGraph ( supergraphSchema , true ) ; } buildQueryPlan ( operation ) { if ( operation . selectionSet . isEmpty ( ) ) { return { kind : 'QueryPlan' } ; } return computeQueryPlan ( this . supergraphSchema , this . federatedQueryGraph , operation ) ; } }