You’re absolutely right about using paths to patch in streamed results. In fact, you can even use the path syntax with GraphQL subscriptions in the case of having n+1 subscriptions (for example, subscribe to all Posts and then open a series of subscriptions for Comments(postId: x). Just send down the path with the payload to patch it in.
Respectfully, but wholly, disagree wrt calling GraphQL a tree. Consider the following:
{
getPost(id: "123") {
comments {
post {
comments
}
}
}
}
It is this circular nature that requires you to differentiate between a GraphQLObjectType and a GraphQLInputObjectType.
Just because the complexity is abstracted away from the developer & the result stringified into JSON doesn’t make it less of a graph. It just means that it is up to your client cache to efficiently rehydrate the graph. For example, if you used a baobab tree as your cache, it’d look identical to a falcor graph.