Class: ActiveAdmin::GraphQL::ResourceConfig
- Inherits:
-
Object
- Object
- ActiveAdmin::GraphQL::ResourceConfig
- Defined in:
- lib/active_admin/graphql/resource_config.rb
Overview
Per-resource GraphQL options set via graphql in ActiveAdmin.register.
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#exclude_attributes ⇒ Object
Returns the value of attribute exclude_attributes.
-
#extension_block ⇒ Object
Returns the value of attribute extension_block.
-
#graphql_type_name ⇒ Object
Returns the value of attribute graphql_type_name.
-
#only_attributes ⇒ Object
Returns the value of attribute only_attributes.
-
#resolve_create_proc ⇒ Object
Returns the value of attribute resolve_create_proc.
-
#resolve_destroy_proc ⇒ Object
Returns the value of attribute resolve_destroy_proc.
-
#resolve_index_proc ⇒ Object
Optional resolver overrides (set from graphql do).
-
#resolve_show_proc ⇒ Object
Returns the value of attribute resolve_show_proc.
-
#resolve_update_proc ⇒ Object
Returns the value of attribute resolve_update_proc.
-
#run_action_payload_type ⇒ Object
Default return type for run-action mutations (
batch,member,collection) when a kind-specific ActiveAdmin::GraphQL::RunActionMutationConfig#payload_type is not set.
Instance Method Summary collapse
- #batch_run_action ⇒ Object
- #collection_action_mutation_for(name) ⇒ Object
- #collection_action_mutations ⇒ Object
- #collection_run_action ⇒ Object
- #disabled? ⇒ Boolean
-
#initialize ⇒ ResourceConfig
constructor
A new instance of ResourceConfig.
- #member_action_mutation_for(name) ⇒ Object
-
#member_action_mutations ⇒ Object
Per
member_actionname (string) -> RunActionMutationConfig for typed fields likeposts_member_publish. - #member_run_action ⇒ Object
Constructor Details
#initialize ⇒ ResourceConfig
Returns a new instance of ResourceConfig.
27 28 29 30 |
# File 'lib/active_admin/graphql/resource_config.rb', line 27 def initialize @enabled = true @exclude_attributes = [] end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
9 10 11 |
# File 'lib/active_admin/graphql/resource_config.rb', line 9 def enabled @enabled end |
#exclude_attributes ⇒ Object
Returns the value of attribute exclude_attributes.
12 13 14 |
# File 'lib/active_admin/graphql/resource_config.rb', line 12 def exclude_attributes @exclude_attributes end |
#extension_block ⇒ Object
Returns the value of attribute extension_block.
13 14 15 |
# File 'lib/active_admin/graphql/resource_config.rb', line 13 def extension_block @extension_block end |
#graphql_type_name ⇒ Object
Returns the value of attribute graphql_type_name.
10 11 12 |
# File 'lib/active_admin/graphql/resource_config.rb', line 10 def graphql_type_name @graphql_type_name end |
#only_attributes ⇒ Object
Returns the value of attribute only_attributes.
11 12 13 |
# File 'lib/active_admin/graphql/resource_config.rb', line 11 def only_attributes @only_attributes end |
#resolve_create_proc ⇒ Object
Returns the value of attribute resolve_create_proc.
19 20 21 |
# File 'lib/active_admin/graphql/resource_config.rb', line 19 def resolve_create_proc @resolve_create_proc end |
#resolve_destroy_proc ⇒ Object
Returns the value of attribute resolve_destroy_proc.
21 22 23 |
# File 'lib/active_admin/graphql/resource_config.rb', line 21 def resolve_destroy_proc @resolve_destroy_proc end |
#resolve_index_proc ⇒ Object
Optional resolver overrides (set from graphql do). SchemaBuilder still owns field names, arguments, and types; procs replace only the Ruby resolution body.
17 18 19 |
# File 'lib/active_admin/graphql/resource_config.rb', line 17 def resolve_index_proc @resolve_index_proc end |
#resolve_show_proc ⇒ Object
Returns the value of attribute resolve_show_proc.
18 19 20 |
# File 'lib/active_admin/graphql/resource_config.rb', line 18 def resolve_show_proc @resolve_show_proc end |
#resolve_update_proc ⇒ Object
Returns the value of attribute resolve_update_proc.
20 21 22 |
# File 'lib/active_admin/graphql/resource_config.rb', line 20 def resolve_update_proc @resolve_update_proc end |
#run_action_payload_type ⇒ Object
Default return type for run-action mutations (batch, member, collection) when a kind-specific ActiveAdmin::GraphQL::RunActionMutationConfig#payload_type is not set. Falls back to ActiveAdmin::GraphQL::RunActionPayload.
25 26 27 |
# File 'lib/active_admin/graphql/resource_config.rb', line 25 def run_action_payload_type @run_action_payload_type end |
Instance Method Details
#batch_run_action ⇒ Object
36 37 38 |
# File 'lib/active_admin/graphql/resource_config.rb', line 36 def batch_run_action @batch_run_action ||= RunActionMutationConfig.new end |
#collection_action_mutation_for(name) ⇒ Object
62 63 64 65 |
# File 'lib/active_admin/graphql/resource_config.rb', line 62 def collection_action_mutation_for(name) key = name.to_s collection_action_mutations[key] ||= RunActionMutationConfig.new end |
#collection_action_mutations ⇒ Object
58 59 60 |
# File 'lib/active_admin/graphql/resource_config.rb', line 58 def collection_action_mutations @collection_action_mutations ||= {} end |
#collection_run_action ⇒ Object
44 45 46 |
# File 'lib/active_admin/graphql/resource_config.rb', line 44 def collection_run_action @collection_run_action ||= RunActionMutationConfig.new end |
#disabled? ⇒ Boolean
32 33 34 |
# File 'lib/active_admin/graphql/resource_config.rb', line 32 def disabled? !enabled end |
#member_action_mutation_for(name) ⇒ Object
53 54 55 56 |
# File 'lib/active_admin/graphql/resource_config.rb', line 53 def member_action_mutation_for(name) key = name.to_s member_action_mutations[key] ||= RunActionMutationConfig.new end |
#member_action_mutations ⇒ Object
Per member_action name (string) -> ActiveAdmin::GraphQL::RunActionMutationConfig for typed fields like posts_member_publish.
49 50 51 |
# File 'lib/active_admin/graphql/resource_config.rb', line 49 def member_action_mutations @member_action_mutations ||= {} end |
#member_run_action ⇒ Object
40 41 42 |
# File 'lib/active_admin/graphql/resource_config.rb', line 40 def member_run_action @member_run_action ||= RunActionMutationConfig.new end |