rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Subgraph Composition

Open ghost opened this issue 6 years ago • 6 comments

The engineering plan only includes schema merging right now, as I'm still working through query execution.

ghost avatar Dec 13 '19 23:12 ghost

@Jannis Comments addressed except for the one from this morning, addressing that now

ghost avatar Dec 17 '19 16:12 ghost

@Jannis I added the list item in the SUMMARY.md, it felt redundant though

ghost avatar Dec 17 '19 18:12 ghost

Ahh, the SUMMARY file is for mdBook

ghost avatar Dec 17 '19 18:12 ghost

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:

  1. Rework the prefetch code to avoid joins (we have the data we need from the joins already in memory when we query for children)
  2. Change EntityQuery and 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.

lutter avatar Dec 18 '19 18:12 lutter

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

vercel[bot] avatar Jan 14 '20 23:01 vercel[bot]

@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.

Jannis avatar Jan 17 '20 13:01 Jannis