How to derive type from relational query?

Hi, I was wondering if there was an easy way to generate types from relational queries that I can then use in TS. Don't seem to see anything in the docs but I could be blind.
Was this page helpful?