Class: Eco::API::UseCases::GraphQL::Helpers::Dashboards::Base::Reader

Inherits:
Object
  • Object
show all
Includes:
Base::ConnectionReader
Defined in:
lib/eco/api/usecases/graphql/helpers/dashboards/base/reader.rb

Overview

NATIVE reader over currentOrganization.dashboardSearch (MinimalDashboardConnection). Lazily paginates and yields Model::MinimalDashboard records.

Use via Helpers::Dashboards::Base#dashboards:

dashboards(query: 'safety').each { |d| ... }
dashboards.to_a

Constant Summary

Constants included from Base::ConnectionReader

Base::ConnectionReader::DEFAULT_PAGE_SIZE

Instance Method Summary collapse

Methods included from Base::ConnectionReader

#each, #page_size, #page_size=, #to_a

Constructor Details

#initialize(graphql, search_conf: nil) ⇒ Reader

Returns a new instance of Reader.

Parameters:

  • graphql (Ecoportal::API::GraphQL)

    the active gem client.

  • search_conf (Hash, nil) (defaults to: nil)

    a Search input hash ({ query:, filters:, sorters: }).



14
15
16
17
# File 'lib/eco/api/usecases/graphql/helpers/dashboards/base/reader.rb', line 14

def initialize(graphql, search_conf: nil)
  @graphql     = graphql
  @search_conf = search_conf
end