I’m trying to wrap my head around Apollo. I’ve read through the docs… it’s quite possible that my answer is there, but I’m too dumb to parse it out.
Say that we have vehicles in inventory. We want to display a vehicle list of those in inventory and their attributes. The UI looks like…
<VehicleList> <Vehicle> <Image /> <Header> <Year /> <Make /> <Model /> </Header> ... </Vehicle> ... </VehicleList>
What components call for the data? For instance,
<VehicleList> (or its container) could query all vehicles in its list, complete with images, year, makes, models, etc and pass those down as props.
<VehicleList> could query for a list of vehicles, pass that list as props, and then each Vehicle could query its own image, year, make, model, etc.
But it seems like the goal of GraphQL is colocating data and UI. So the Apollo/GraphQL way seems to be have each
<Image> component query its own image. Is that the approach? VehicleList generates a list of vehicles,
<Vehicle> passes its vehicle Id to its children. And the children that render data make the query?