Subgraph dependencies

At moment need to redeploy federated graph with many services to a new environment, it is kind of hard without knowing in which order they need to be deployed, e.g.:

you are deploying ServiceA, and while trying to make apollo service push receive an error that this service trying to extend not existing dependency, but where this dependency, and what other subgraphs should be deployed first?

to me it seems that it should be possible to somehow figure this out from service schema definitions

BTW wondering what will happen if there is two way extension