TypeQueries as functions