Class: Ecoportal::API::GraphQL::Payload::LocationStructure::ApplyCommands
Constant Summary
Common::GraphQL::Model::Diffable::DIFF_CLASS
Instance Method Summary
collapse
#conflictingIds, #conflictingIds?, #locations_error?, #locations_error_doc, #validationErrors, #validationErrors?
#success?
#as_input
#as_update, #dirty?
Instance Method Details
#error? ⇒ Boolean
Also known as:
errors?
16
17
18
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb', line 16
def error?
super || result_errors? || locations_error?
end
|
#error_doc ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb', line 21
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
42
43
44
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb', line 42
def result_errors
results.select(&:error?)
end
|
#result_errors? ⇒ Boolean
38
39
40
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/apply_commands.rb', line 38
def result_errors?
result_errors.any?
end
|