Module: Ecoportal::API::GraphQL::Error::LocationsError::FetchNested

Instance Method Summary collapse

Instance Method Details

#loc_err_conflicting_idsObject



35
36
37
38
39
# File 'lib/ecoportal/api/graphql/error/locations_error/fetch_nested.rb', line 35

def loc_err_conflicting_ids
  return [] unless (err = error)

  err.conflictingIds || []
end

#loc_err_conflicting_ids?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/ecoportal/api/graphql/error/locations_error/fetch_nested.rb', line 27

def loc_err_conflicting_ids?
  loc_err_conflicting_ids.any?
end

#locations_error?Boolean

Returns:

  • (Boolean)


21
22
23
24
25
# File 'lib/ecoportal/api/graphql/error/locations_error/fetch_nested.rb', line 21

def locations_error?
  return false if error.nil?

  !error.empty?
end

#locations_error_docObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ecoportal/api/graphql/error/locations_error/fetch_nested.rb', line 7

def locations_error_doc
  return unless locations_error?

  if loc_err_conflicting_ids?
    {
      conflictingIds: loc_err_conflicting_ids.doc
    }
  elsif validationErrors?
    {
      validationErrors: validationErrors.doc
    }
  end
end

#validationErrorsObject



41
42
43
44
45
# File 'lib/ecoportal/api/graphql/error/locations_error/fetch_nested.rb', line 41

def validationErrors
  return [] unless (err = error)

  err.validationErrors || []
end

#validationErrors?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/ecoportal/api/graphql/error/locations_error/fetch_nested.rb', line 31

def validationErrors?
  validationErrors.any?
end