Consider removing now unused parts of @apollo/subgraph
#1798
Labels
P4
An issue that should be addressed eventually.
@apollo/subgraph
#1798
The main method of
@apollo/subgraph
, the one user mostly care about, isbuildSubgraphSchema
. In federation 2, that method uses the code from the@apollo/federation-internals
to do most of it's work (filling up all the missing federation bits, including adding missing directive definitions, adding the_service
and_entities
fields, etc...). That is, the client-side code uses the same sources as the server side one, which is probably a good thing.However, none of the previous scaffolding that was previously used to implement that
buildSubgraphSchema
has been removed, and this mostly due to time constraints leading to the final release. It slips by if you will.But that means that
@apollo/subgraph
has a lot of essentially dead code, which we should consider removing. In particular:schema-helper
methods used, likebuildSchemaFromSDL
printSubgraphSchema
method is also not used and not very useful anymore. Printing the schema outputted bybuildSubgraphSchema
"normally" should be good for essentially all purposes.A concern however is that all of this code is essentially exported, so some users could directly rely on it, even if this wasn't the primary intent. So this should probably be taken into account for deciding how we move forward with this issue. At a minimum, we should probably start with a period of deprecation for the code we want to remove.
The text was updated successfully, but these errors were encountered: