TownHallHQ / TownHall

MIT License
27 stars 13 forks source link

feat: query posts from user edge #130

Closed EstebanBorai closed 11 months ago

EstebanBorai commented 11 months ago

Now we query posts for a user from its edge which means that instead of querying posts by a user with ID user_1234 like this:

query {
  posts(filter: { author_id: 'user_1234' }) {
    # -- snip --
  }
}

We will do:

query {
  users(filter: { id: 'user_1234' }) {
    # -- snip --
        posts(first: 20) {
          id
          title
          # -- snip --
        }
  }
}