Adding query support to relationship fields