The Hasura team uses a "dataloader" approach to optimize GraphQL joins. They analyze queries ahead of execution and modify each sub-query to extract required join keys. This process involves issuing individual calls to the remote schema, stitching results together, and tracking added columns for join keys. The complexity increases with nested joins and ambiguous paths in some cases. To handle these challenges, they refined their join tree definition by allowing branches to be annotated with a typename and retrieving the runtime type using a phantom field.