apollographql / rover

✨🤖 🐶 The CLI for Apollo GraphOS
https://rover.apollo.dev
Other
402 stars 83 forks source link

`rover dev` should provide an endpoint to fetch subgraph SDLs #1269

Open EverlastingBugstopper opened 1 year ago

EverlastingBugstopper commented 1 year ago

rover dev spins up a router which embeds sandbox. this sandbox endpoint does not have knowledge of all of the subgraph SDLs, only the API schema provided by the router. this is great for running queries since it's what clients will do, but it's not great for navigability in sandbox itself. the checks page is weird and you can't see all of the different subgraphs in the UI (even though we have UI for displaying multiple subgraph SDLs).

rover dev should spin up a proxy in front of the router, normal requests will pass through to the router, and requests to http://localhost:3000/subgraphs should return a JSON blob of all the subgraphs and their SDL like so:

{
  "subgraphs": {
    "subgraph-a": "subgraph-a SDL",
    "subgraph-b": "subgraph-b SDL",
  } 
}
abernix commented 1 year ago

would love to be included in this conversation eventually whenever we get to it.