Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

graphql

hero {
  name
  friends {
    name
  }
}

sql

select
  (select name from people as p where p.id = h.id) as name,
  array(select
    (select name from people as p2 where p2.id = hf.friend_id) as name
    from hero_friends as hf
    where hf.hero_id = h.id
  ) as friends
from heroes as h;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.