Class: Ecoportal::API::GraphQL::Payload::LocationStructure::ApplyCommands
Constant Summary
Common::GraphQL::Model::Diffable::DIFF_CLASS
Instance Method Summary
collapse
#loc_err_conflicting_ids, #loc_err_conflicting_ids?, #locations_error?, #locations_error_doc, #validationErrors, #validationErrors?
#success?
#as_input
#as_update, #dirty?
Instance Method Details
#error? ⇒ Boolean
Also known as:
errors?
17
18
19
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb', line 17
def error?
super || result_errors? || locations_error?
end
|
#error_doc ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb', line 22
def error_doc
err_doc = super
return err_doc if err_doc
if result_errors?
{
results: [
result_errors.first&.error_doc
]
}
elsif locations_error?
{
locationsError: locations_error_doc
}
end
end
|
#result_errors ⇒ Object
43
44
45
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb', line 43
def result_errors
results.select(&:error?)
end
|
#result_errors? ⇒ Boolean
39
40
41
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb', line 39
def result_errors?
result_errors.any?
end
|