Subgraph Composition
The engineering plan only includes schema merging right now, as I'm still working through query execution.
@Jannis Comments addressed except for the one from this morning, addressing that now
@Jannis I added the list item in the SUMMARY.md, it felt redundant though
Ahh, the SUMMARY file is for mdBook
There's one issue here when it comes to querying data from the Store: with prefetching, we sometimes join two tables for a query parents { children { id } } when we get the children. With composition, it is possible that parents and children live in different subgraphs, something that EntityQuery can currently not express. I see two options for making this work:
- Rework the prefetch code to avoid joins (we have the data we need from the joins already in memory when we query for
children) - Change
EntityQueryand the code that runs these queries to allow mixing entities from multiple subgraphs
Since, at some point, we will also want to be able to filter by child fields (parents(where: {children.color: green}) { id }) we should go with the second option, since for that we will need to join parents and children when we look up the parents.
This pull request is being automatically deployed with ZEIT Now (learn more). To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://zeit.co/graphprotocol/rfcs/dx4p8vuub ✅ Preview: https://rfcs-git-subgraph-composition.graphprotocol1.now.sh
@lutter Have your concerns been addressed yet? It reads more like it is relevant to query execution rather than merging, i.e. #12 rather than this PR.