union SearchResult = Post | User | Tag | Group

type postSearchResults {
  postCount: Int
  posts: [Post]!
}

type userSearchResults {
  userCount: Int
  users: [User]!
}

type hashtagSearchResults {
  hashtagCount: Int
  hashtags: [Tag]!
}

type groupSearchResults {
  groupCount: Int
  groups: [Group]!
}

type Query {
  searchPosts(query: String!, firstPosts: Int, postsOffset: Int): postSearchResults!
  searchUsers(query: String!, firstUsers: Int, usersOffset: Int): userSearchResults!
  searchGroups(query: String!, firstGroups: Int, groupsOffset: Int): groupSearchResults!
  searchHashtags(query: String!, firstHashtags: Int, hashtagsOffset: Int): hashtagSearchResults!
  searchResults(query: String!, limit: Int = 5): [SearchResult]!
}
