diff --git a/app/graphql/types/input/reference_value_input_type.rb b/app/graphql/types/input/reference_value_input_type.rb index ef0fcaac..073bd40f 100644 --- a/app/graphql/types/input/reference_value_input_type.rb +++ b/app/graphql/types/input/reference_value_input_type.rb @@ -20,6 +20,10 @@ class ReferenceValueInputType < Types::BaseInputObject argument :input_index, GraphQL::Types::Int, required: false, description: 'The index of the referenced input' + + argument :input_type_identifier, GraphQL::Types::String, + required: false, + description: 'The identifier of the input type' end end end diff --git a/app/graphql/types/reference_value_type.rb b/app/graphql/types/reference_value_type.rb index 89ad4376..c09dac0f 100644 --- a/app/graphql/types/reference_value_type.rb +++ b/app/graphql/types/reference_value_type.rb @@ -21,6 +21,12 @@ class ReferenceValueType < Types::BaseObject null: true, description: 'The index of the referenced input' + # rubocop:disable GraphQL/ExtractType + field :input_type_identifier, GraphQL::Types::String, + null: true, + description: 'The identifier of the input type' + # rubocop:enable GraphQL/ExtractType + id_field ReferenceValue timestamps diff --git a/app/services/namespaces/projects/flows/update_service.rb b/app/services/namespaces/projects/flows/update_service.rb index bf053af9..634313e8 100644 --- a/app/services/namespaces/projects/flows/update_service.rb +++ b/app/services/namespaces/projects/flows/update_service.rb @@ -231,7 +231,8 @@ def update_node_parameters(t, current_node, current_node_input, all_nodes) node_function: referenced_node[:node], reference_paths: reference_paths, parameter_index: parameter.value.reference_value.parameter_index, - input_index: parameter.value.reference_value.input_index + input_index: parameter.value.reference_value.input_index, + input_type_identifier: parameter.value.reference_value.input_type_identifier ) else db_parameters[index].reference_value&.destroy diff --git a/db/migrate/20260404122243_add_input_type_identifier_to_reference_value.rb b/db/migrate/20260404122243_add_input_type_identifier_to_reference_value.rb new file mode 100644 index 00000000..96dfe61e --- /dev/null +++ b/db/migrate/20260404122243_add_input_type_identifier_to_reference_value.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddInputTypeIdentifierToReferenceValue < Code0::ZeroTrack::Database::Migration[1.0] + def change + add_column :reference_values, :input_type_identifier, :text + end +end diff --git a/db/schema_migrations/20260404122243 b/db/schema_migrations/20260404122243 new file mode 100644 index 00000000..7f15ab21 --- /dev/null +++ b/db/schema_migrations/20260404122243 @@ -0,0 +1 @@ +49318d6907f86c2cec72df175314b6afdee6bc1a8cdc6edfa34f8c1a6c4908e1 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 9ba1ed98..85f5e285 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -670,6 +670,7 @@ CREATE TABLE reference_values ( node_function_id bigint, parameter_index integer, input_index integer, + input_type_identifier text, CONSTRAINT check_a2e3734389 CHECK ((num_nonnulls(parameter_index, input_index) = ANY (ARRAY[0, 2]))) ); diff --git a/docs/graphql/input_object/referencevalueinput.md b/docs/graphql/input_object/referencevalueinput.md index ed532bd2..6e2c40ff 100644 --- a/docs/graphql/input_object/referencevalueinput.md +++ b/docs/graphql/input_object/referencevalueinput.md @@ -9,6 +9,7 @@ Input type for reference value | Name | Type | Description | |------|------|-------------| | `inputIndex` | [`Int`](../scalar/int.md) | The index of the referenced input | +| `inputTypeIdentifier` | [`String`](../scalar/string.md) | The identifier of the input type | | `nodeFunctionId` | [`NodeFunctionID`](../scalar/nodefunctionid.md) | The referenced value unless referencing the flow input | | `parameterIndex` | [`Int`](../scalar/int.md) | The index of the referenced parameter | | `referencePath` | [`[ReferencePathInput!]!`](../input_object/referencepathinput.md) | The paths associated with this reference value | diff --git a/docs/graphql/object/referencevalue.md b/docs/graphql/object/referencevalue.md index 24b8b549..8487fbbf 100644 --- a/docs/graphql/object/referencevalue.md +++ b/docs/graphql/object/referencevalue.md @@ -11,6 +11,7 @@ Represents a reference value in the system. | `createdAt` | [`Time!`](../scalar/time.md) | Time when this ReferenceValue was created | | `id` | [`ReferenceValueID!`](../scalar/referencevalueid.md) | Global ID of this ReferenceValue | | `inputIndex` | [`Int`](../scalar/int.md) | The index of the referenced input | +| `inputTypeIdentifier` | [`String`](../scalar/string.md) | The identifier of the input type | | `nodeFunctionId` | [`NodeFunctionID`](../scalar/nodefunctionid.md) | The referenced value unless referencing the flow input. | | `parameterIndex` | [`Int`](../scalar/int.md) | The index of the referenced parameter | | `referencePath` | [`[ReferencePath!]!`](../object/referencepath.md) | The paths associated with this reference value. | diff --git a/spec/factories/reference_values.rb b/spec/factories/reference_values.rb index 5b42a9e8..fbfc2eda 100644 --- a/spec/factories/reference_values.rb +++ b/spec/factories/reference_values.rb @@ -5,5 +5,6 @@ node_function parameter_index { nil } input_index { nil } + input_type_identifier { nil } end end