Class: HQ::GraphQL::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/hq/graphql/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default_scope: ->(scope, _context) { scope }, extract_class: ->(klass) { klass.to_s.gsub(/^Resources|Resource$/, "") }, resource_lookup: ->(klass) { "::Resources::#{klass}Resource".safe_constantize || "::Resources::#{klass}".safe_constantize }, **options) ⇒ Config

Returns a new instance of Config.



14
15
16
17
18
19
20
21
# File 'lib/hq/graphql/config.rb', line 14

def initialize(
  default_scope: ->(scope, _context) { scope },
  extract_class: ->(klass) { klass.to_s.gsub(/^Resources|Resource$/, "") },
  resource_lookup: ->(klass) { "::Resources::#{klass}Resource".safe_constantize || "::Resources::#{klass}".safe_constantize },
  **options
)
  super
end

Instance Attribute Details

#authorizeObject

Returns the value of attribute authorize

Returns:

  • (Object)

    the current value of authorize



5
6
7
# File 'lib/hq/graphql/config.rb', line 5

def authorize
  @authorize
end

#authorize_fieldObject

Returns the value of attribute authorize_field

Returns:

  • (Object)

    the current value of authorize_field



5
6
7
# File 'lib/hq/graphql/config.rb', line 5

def authorize_field
  @authorize_field
end

#default_scopeObject

Returns the value of attribute default_scope

Returns:

  • (Object)

    the current value of default_scope



5
6
7
# File 'lib/hq/graphql/config.rb', line 5

def default_scope
  @default_scope
end

#extract_classObject

Returns the value of attribute extract_class

Returns:

  • (Object)

    the current value of extract_class



5
6
7
# File 'lib/hq/graphql/config.rb', line 5

def extract_class
  @extract_class
end

#resource_lookupObject

Returns the value of attribute resource_lookup

Returns:

  • (Object)

    the current value of resource_lookup



5
6
7
# File 'lib/hq/graphql/config.rb', line 5

def resource_lookup
  @resource_lookup
end

#use_experimental_associationsObject

Returns the value of attribute use_experimental_associations

Returns:

  • (Object)

    the current value of use_experimental_associations



5
6
7
# File 'lib/hq/graphql/config.rb', line 5

def use_experimental_associations
  @use_experimental_associations
end