Module: Eco::API::UseCases::GraphQL::Helpers::Pages::Creatable

Included in:
Samples::Pages::Register::Base
Defined in:
lib/eco/api/usecases/graphql/helpers/pages/creatable.rb

Overview

Native GraphQL re-expression of OozeSamples::Helpers::Creatable.

Provides the "create a new entry (page) from a template" flow used by register-processing use cases. Mirrors the v2 Creatable structure (creating_new_page -> drafting_entry -> create_entry -> create_ooze) but talks to the native GraphQL stack (graphql.pages.get_new / graphql.pages.create) and respects simulate? for dry-run feedback.

Included via the base-type guard: it can only be mixed into the native register case (Samples::Pages::Register::Base), which supplies the create_ooze hook + KPI counters it drives.

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.validate_base_type!(base) ⇒ Object

Raises:

  • (LoadError)


65
66
67
68
69
70
71
72
73
74
# File 'lib/eco/api/usecases/graphql/helpers/pages/creatable.rb', line 65

def validate_base_type!(base)
  return super if defined?(super)

  register_base = Eco::API::UseCases::GraphQL::Samples::Pages::Register::Base
  msg  = "#{self} can only be included in #{register_base}"
  msg << "\nCan't be included in #{base}"
  raise LoadError, msg unless base <= register_base

  true
end