Class: Ecoportal::API::GraphQL::Payload::LocationStructure::Draft::Publish
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
24
25
26
27
28
29
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/draft/publish.rb', line 24
def error?
super ||
locations_error? ||
result_errors? ||
!ok?
end
|
#error_doc ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/draft/publish.rb', line 31
def error_doc
err_doc = super
return err_doc if err_doc
if locations_error?
{
locationsError: locations_error_doc
}
elsif result_errors?
{
results: [result_errors.first&.error_doc]
}
elsif !ok?
{
ok: ok
}
end
end
|
#ok? ⇒ Boolean
20
21
22
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/draft/publish.rb', line 20
def ok?
ok != false
end
|
#result_errors ⇒ Object
54
55
56
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/draft/publish.rb', line 54
def result_errors
results.select(&:error?)
end
|
#result_errors? ⇒ Boolean
50
51
52
|
# File 'lib/ecoportal/api/graphql/payload/location_structure/draft/publish.rb', line 50
def result_errors?
result_errors.any?
end
|