We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f657fef + 5555282 commit a2cb492Copy full SHA for a2cb492
1 file changed
app/graphql/types/search_result_type.rb
@@ -1,5 +1,11 @@
1
# frozen_string_literal: true
2
class Types::SearchResultType < Types::BaseObject
3
- field :entries, [Types::SearchResultEntryType], null: false
4
- field :total_entries, Int, null: false
+ description "A paginated search result containing matching entries and total count"
+
5
+ field :entries, [Types::SearchResultEntryType], null: false, description: "The results of the search"
6
+ field :total_entries, Int, null: false, description: "The total number of entries matching the search query"
7
8
+ def entries
9
+ object.entries.filter { |entry| policy(entry.model).read? }
10
+ end
11
end
0 commit comments