title: Is it possible to access fields in a joined table in Vapor?
body: <p>I have a Persons table and an Events table that are related via an Attends table, such that a record exists the Attends table when I wish to record the fact that a person is due to attend a particular Event in a particular role (e.g. organiser, etc.):</p>
  
  <pre><code>Persons
  +----+-------------+
  | id | surname     |
  +----+-------------+
  |  1 | Robinson    |
  |  2 | Savage      |
  ...
  
  Events
  +----+-----------------------+
  | id | name                  |
  +----+-----------------------+
  |  1 | Half Term Competition |
  |  2 | Christmas Competition |
  ...
  
  attends
  +---------+----------+--------+
  | eventId | personId | roleId |
  +---------+----------+--------+
  |       1 |        1 |      1 |
  |       1 |        2 |      6 |
  ...
  </code></pre>
  
  <p>I want to produce a list of who is going and what they are doing at an event, but I can't find a way of doing it using .join() in Vapor query. It seems that you can filter on the joined table, but not include any of the fields. Am I missing something or is this impossible?</p>
  
  <p>I've tried many variations on the theme of:</p>
  
  <pre><code>Person.join(Attends.self).filter(Attends.self,Event.foreignIdKey == eventId)
  </code></pre>
  
  <p>I get the correct Person records, but no way of accessing what their 'role' is from the joined Attends record.</p>
  
  <p>If I do a raw query, then it returns a Node representation. I can easily view this using Leaf, but it is not at all obvious how to iterate over it in the way I would like to generate a PDF with images, etc.</p>