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

Instance Method Summary collapse

Instance Method Details

#conflictingIdsObject



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

def conflictingIds
  return [] unless (err = error)

  err.conflictingIds || []
end

#conflictingIds?Boolean

Returns:

  • (Boolean)


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

def conflictingIds?
  conflictingIds.any?
end

#locations_error?Boolean

Returns:

  • (Boolean)


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

def locations_error?
  !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 conflictingIds?
    {
      conflictingIds: conflictingIds.doc
    }
  elsif validationErrors?
    {
      validationErrors: validationErrors.doc
    }
  end
end

#validationErrorsObject



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

def validationErrors
  return [] unless (err = error)

  err.validationErrors || []
end

#validationErrors?Boolean

Returns:

  • (Boolean)


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

def validationErrors?
  validationErrors.any?
end