Class: Ecoportal::API::GraphQL::Base::Page::DataField::LeafDiffService

Inherits:
Common::GraphQL::Model::Diffable::DiffService show all
Defined in:
lib/ecoportal/api/graphql/base/page/data_field.rb

Overview

Diff strategy for leaf data fields.

A DataField's array attributes (options, peopleIds, contractors, pages, fileContainers, items, ...) are declared with passarray, which registers them as cascaded attributes. The default DiffService strips cascaded keys from the flat classic diff (doc_with_non_cascaded_attributes) on the assumption that a later diff_reduce pass re-adds them by cascading into nested GraphQL::Model children. DataField arrays are plain hashes / strings, not GraphQL::Model objects, so that re-add never happens and the array change becomes invisible to the diff (scalar passthrough fields are unaffected). For a leaf model we want every doc key diffed inline, so this service keeps cascaded keys in place.

Constant Summary

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

Common::GraphQL::Model::Diffable::HashDiffNesting::META_KEYS, Common::GraphQL::Model::Diffable::HashDiffNesting::NO_CHANGES

Instance Attribute Summary

Attributes inherited from Common::GraphQL::Model::Diffable::ClassicDiffService

#subject

Method Summary

Methods inherited from Common::GraphQL::Model::Diffable::DiffService

#diff, #flat?, #initialize

Methods included from Common::GraphQL::HashHelpers::InstanceMethods

#deep_dup, #except_keys, #keys_to_s_deep, #keys_to_sym_deep, #remove_nil_keys_deep

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

#change_diff

Methods inherited from Common::GraphQL::Model::Diffable::ClassicDiffService

#diff, #initialize

Constructor Details

This class inherits a constructor from Ecoportal::API::Common::GraphQL::Model::Diffable::DiffService