That way the parent can just render whatever components it wants without having to worry about what data they require.
That way the parent can just render whatever components it wants without having to worry about what data they require.
Consider the Artist.Name and Artist.Disambiguation components in my GitHub example. Notice how they don't need the `mbid` prop that the ancestor component provides. I want a component like that for every single field in my Artist schema. If every one of those components duplicated the artist query, they'd all need to be passed the `mbid`, because that's how it determines what artist to retrieve. It's possible to do some tricks with `context` like I'm doing now, but I don't really trust that it's a better solution than having one query execution point with an extendable query.
This is the API I want:
<Artist mbid="abc-123">
<Artist.Name />
<Artist.Disambiguation />
<SomeOtherComponentThatHasArtistFieldDescendants />
</Artist>
This is the API you're saying I would have to use with vanilla Relay and Apollo: <Artist mbid="abc-123">
<Artist.Name mbid="abc-123" />
<Artist.Disambiguation mbid="abc-123" />
<SomeOtherComponentThatHasArtistFieldDescendants mbid="abc-123" />
</Artist>Considering neither are possible with vanilla Relay and Apollo and I need to build these helper HOCs either way, I don't really see why what you're proposing is better. I had already considered them both and deliberately did not do it that way.
It’s easy with Relay. With Classic you render a RelayRenderer. In Relay Modern you render a QueryRenderer. Either way, you can issue more queries than just your root query and it’s as easy as rendering a React component.