Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/graphql/types/input/reference_value_input_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions app/graphql/types/reference_value_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion app/services/namespaces/projects/flows/update_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions db/schema_migrations/20260404122243
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
49318d6907f86c2cec72df175314b6afdee6bc1a8cdc6edfa34f8c1a6c4908e1
1 change: 1 addition & 0 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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])))
);

Expand Down
1 change: 1 addition & 0 deletions docs/graphql/input_object/referencevalueinput.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
1 change: 1 addition & 0 deletions docs/graphql/object/referencevalue.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
1 change: 1 addition & 0 deletions spec/factories/reference_values.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
node_function
parameter_index { nil }
input_index { nil }
input_type_identifier { nil }
end
end