Class: Decidim::Core::UserEntityList
- Inherits:
-
Object
- Object
- Decidim::Core::UserEntityList
- Includes:
- NeedsApiFilterAndOrder
- Defined in:
- lib/decidim/api/functions/user_entity_list.rb
Overview
A resolver for the GraphQL users/groups endpoints Used in the keyword “users”, ie:
users(filter: “foo”)
name
Instance Method Summary collapse
- #call(_obj, args, ctx) ⇒ Object
-
#initialize ⇒ UserEntityList
constructor
A new instance of UserEntityList.
Methods included from NeedsApiFilterAndOrder
#add_filter_keys, #add_order_keys
Constructor Details
#initialize ⇒ UserEntityList
Returns a new instance of UserEntityList.
15 16 17 |
# File 'lib/decidim/api/functions/user_entity_list.rb', line 15 def initialize @model_class = Decidim::UserBaseEntity end |
Instance Method Details
#call(_obj, args, ctx) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/decidim/api/functions/user_entity_list.rb', line 19 def call(_obj, args, ctx) @query = Decidim::UserBaseEntity .where(organization: ctx[:current_organization]) .confirmed .not_blocked .includes(avatar_attachment: :blob) add_filter_keys(args[:filter]) add_order_keys(args[:order].to_h) @query end |