Class: ActiveAdmin::GraphQL::RunActionMutationConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/active_admin/graphql/run_action_mutation_config.rb

Overview

Pairs return type and optional resolver for one run-action mutation kind (batch, member, or collection). Default return type resolution falls back to ActiveAdmin::GraphQL::ResourceConfig#run_action_payload_type, then RunActionPayload.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#arguments_procObject

Optional block evaluated in the graphql-ruby field DSL context (argument, …) for per-action fields.



14
15
16
# File 'lib/active_admin/graphql/run_action_mutation_config.rb', line 14

def arguments_proc
  @arguments_proc
end

#authorizeObject

Optional authorization toggle for this mutation configuration. nil means namespace default.



16
17
18
# File 'lib/active_admin/graphql/run_action_mutation_config.rb', line 16

def authorize
  @authorize
end

#payload_typeClass?

Returns GraphQL::Schema::Object subclass.

Returns:

  • (Class, nil)

    GraphQL::Schema::Object subclass



10
11
12
# File 'lib/active_admin/graphql/run_action_mutation_config.rb', line 10

def payload_type
  @payload_type
end

#resolve_procProc?

Returns:

  • (Proc, nil)


12
13
14
# File 'lib/active_admin/graphql/run_action_mutation_config.rb', line 12

def resolve_proc
  @resolve_proc
end

Class Method Details

.ensure_graphql_object_subclass!(type) ⇒ Object



18
19
20
21
22
# File 'lib/active_admin/graphql/run_action_mutation_config.rb', line 18

def self.ensure_graphql_object_subclass!(type)
  unless type.is_a?(Class) && type < ::GraphQL::Schema::Object
    raise ArgumentError, "Expected a GraphQL::Schema::Object subclass, got #{type.inspect}"
  end
end