Module: Eco::API::UseCases::GraphQL::Samples::Pages::Template
- Defined in:
- lib/eco/api/usecases/graphql/samples/pages/template.rb,
lib/eco/api/usecases/graphql/samples/pages/template/base.rb,
lib/eco/api/usecases/graphql/samples/pages/template/deploy.rb,
lib/eco/api/usecases/graphql/samples/pages/template/csv_build.rb,
lib/eco/api/usecases/graphql/samples/pages/template/deploy/loop.rb,
lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb,
lib/eco/api/usecases/graphql/samples/pages/template/command_emitter.rb,
lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb,
lib/eco/api/usecases/graphql/samples/pages/template/csv_build/parser.rb,
lib/eco/api/usecases/graphql/samples/pages/template/csv_build/builder.rb,
lib/eco/api/usecases/graphql/samples/pages/template/deploy/drift_report.rb,
lib/eco/api/usecases/graphql/samples/pages/template/csv_build/format_map.rb,
lib/eco/api/usecases/graphql/samples/pages/template/deploy/sync_readiness.rb,
lib/eco/api/usecases/graphql/samples/pages/template/deploy/recording_executor.rb
Overview
NOTE: nested as module Template + class Base rather than the compact class Template::Base
ON PURPOSE. The compact form leaves Template out of this file's lexical scope, so the bare
CommandEmitter reference in #desired_commands resolved against Base and Pages only and raised
NameError on every call -- the class could never run. Sibling files (command_emitter.rb,
csv_build/builder.rb) all open the Template module properly, which is why their bare references
to each other work. Keep this nesting.
Build-from-scratch template (workflow) construction use case.
A subclass declares the desired template structure in #declare(emitter) using the
CommandEmitter DSL; the base turns it into an ordered command batch and applies it via
graphql.template.create / update (executeWorkflowCommands). simulate? previews the batch
without writing. The emitted batch (#desired_commands) is unit-testable with no live client.
class Custom::UseCase::BuildIncidentTemplate < Samples::Pages::Template::Base
name 'build-incident-template'
def declare(t)
t.stage(name: 'Report', ordering: 0) do |stage|
stage.section(layout: 'content') do |section|
section.field(label: 'Description', field_type: 'plain_text')
end
end
end
end
Defined Under Namespace
Modules: CsvBuild, Deploy Classes: Base, CommandEmitter