Class: Ecoportal::API::GraphQL::Logic::Payload

Inherits:
BaseModel show all
Defined in:
lib/ecoportal/api/graphql/logic/payload.rb

Defined Under Namespace

Classes: GenericItem

Constant Summary

Constants included from Common::GraphQL::Model::Diffable

Common::GraphQL::Model::Diffable::DIFF_CLASS

Instance Method Summary collapse

Methods included from Common::GraphQL::Model::AsInput

#as_input

Methods included from Common::GraphQL::Model::Diffable

#as_update, #dirty?

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ecoportal/api/graphql/logic/payload.rb', line 21

def error?
  errors && !errors.empty?
end

#error_docObject



29
30
31
32
33
34
35
# File 'lib/ecoportal/api/graphql/logic/payload.rb', line 29

def error_doc
  return unless (err_doc = errors&.doc)

  {
    validationErrors: err_doc
  }
end

#success?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ecoportal/api/graphql/logic/payload.rb', line 25

def success?
  !error?
end