@powerhousedao/reactor-api 1.29.13-dev.5 → 1.29.14-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,9 +103,9 @@ export class SubgraphManager {
103
103
  });
104
104
  }
105
105
  async #setupSubgraphs(router) {
106
- for (const supergraph of Object.keys(this.subgraphs)) {
106
+ for (const [supergraph, subgraphs] of this.subgraphs.entries()) {
107
107
  const supergraphEndpoints = {};
108
- for (const subgraph of this.subgraphs.get(supergraph) ?? []) {
108
+ for (const subgraph of subgraphs) {
109
109
  const subgraphConfig = this.#getLocalSubgraphConfig(subgraph.name);
110
110
  if (!subgraphConfig)
111
111
  continue;
@@ -113,7 +113,7 @@ export class SubgraphManager {
113
113
  const schema = createSchema(this.reactor, subgraphConfig.resolvers, subgraphConfig.typeDefs);
114
114
  // create and start apollo server
115
115
  const server = this.#createApolloServer(schema);
116
- const path = `${subgraph.path ? "/" + subgraph.path : ""}/${subgraphConfig.name}`;
116
+ const path = `${subgraph.path ? "/" + subgraph.path : ""}${supergraph !== "" ? "/" + supergraph : ""}/${subgraphConfig.name}`;
117
117
  await server.start();
118
118
  await this.#waitForServer(server);
119
119
  this.#setupApolloExpressMiddleware(server, router, path);