Skip to main content

Querying queries

Queries can be queried themselves. This is a useful for composing queries together.

For example, imagine we are building a Twitter clone using datalog. We can build a User's timeline by querying Posts and Follows. But what if we also wanted to keep track of the number of unseen posts in the timeline? We could copy paste the original query and tweak it, or we could query our original query!

Here's how it looks in practice:

Live Editor
Result
Loading...