|
@@ -7,12 +7,9 @@ module Gql::Types
|
|
|
|
|
|
field :attribute, Gql::Types::ObjectManager::FrontendAttributeType, null: false, description: 'The object attribute record'
|
|
|
field :value, GraphQL::Types::JSON, description: "The value of the current object's object attribute"
|
|
|
+ field :rendered_value, GraphQL::Types::JSON, description: 'Rendered version of the value that considers templates which are defined'
|
|
|
|
|
|
- field :rendered_value, GraphQL::Types::JSON, description: 'Rendered version of the value that considers templates which are defined' do
|
|
|
- argument :template_render_context, Gql::Types::Input::TemplateRenderContextInputType, description: 'Context data for the text module rendering, e.g. customer data.'
|
|
|
- end
|
|
|
-
|
|
|
- def rendered_value(template_render_context:)
|
|
|
+ def rendered_value
|
|
|
value = @object[:value]
|
|
|
return value if !value.is_a?(String)
|
|
|
|
|
@@ -20,7 +17,7 @@ module Gql::Types
|
|
|
return value if !template
|
|
|
|
|
|
NotificationFactory::Renderer.new(
|
|
|
- objects: template_render_context.to_context_hash,
|
|
|
+ objects: { @object[:parent].class.name.downcase.to_sym => @object[:parent] },
|
|
|
template: template,
|
|
|
escape: false
|
|
|
).render
|