Module: Rails::GraphQL::Request::Preparable

Included in:
Component
Defined in:
lib/rails/graphql/request/steps/preparable.rb

Overview

Helper methods for the prepare step of a request

Instance Method Summary collapse

Instance Method Details

#prepare!Object

Prepare the object



9
10
11
12
13
# File 'lib/rails/graphql/request/steps/preparable.rb', line 9

def prepare!
  prepare
rescue => error
  report_exception(error)
end

#prepared_data!Object

Marks that the field has prepared data that came outside from the request



17
18
19
# File 'lib/rails/graphql/request/steps/preparable.rb', line 17

def prepared_data!
  @prepared_data = true
end

#prepared_data?Boolean

Checks if the field has prepared data

Returns:

  • (Boolean)


22
23
24
# File 'lib/rails/graphql/request/steps/preparable.rb', line 22

def prepared_data?
  defined?(@prepared_data) && @prepared_data
end