class GraphQL::SmartSelect::Options
Provide methods to expose keys for available options db_columns and smart_select
Attributes
list_of_nodes[R]
smart_select[R]
Public Class Methods
new(list_of_nodes, smart_select)
click to toggle source
# File lib/graphql/smart_select/options.rb, line 12 def initialize(list_of_nodes, smart_select) @list_of_nodes = list_of_nodes @smart_select = smart_select end
Public Instance Methods
expose()
click to toggle source
# File lib/graphql/smart_select/options.rb, line 17 def expose db_columns_fields | smart_select_fields end
Private Instance Methods
db_columns_fields()
click to toggle source
# File lib/graphql/smart_select/options.rb, line 23 def db_columns_fields list_of_nodes.flat_map do |_, node| node.definition.metadata[:type_class].db_columns&.map(&:to_s) end end
smart_select_fields()
click to toggle source
# File lib/graphql/smart_select/options.rb, line 29 def smart_select_fields smart_select.is_a?(Array) ? smart_select.map(&:to_s) : [] end