diff --git a/app/graphql/types/flow_type.rb b/app/graphql/types/flow_type.rb index 10ade3a8..577367dd 100644 --- a/app/graphql/types/flow_type.rb +++ b/app/graphql/types/flow_type.rb @@ -22,7 +22,7 @@ class FlowType < Types::BaseObject method: :flow_settings, description: 'The settings of the flow' field :starting_node_id, Types::GlobalIdType[::NodeFunction], - null: false, + null: true, description: 'The ID of the starting node of the flow' field :type, Types::FlowTypeType, null: false, @@ -41,7 +41,7 @@ class FlowType < Types::BaseObject timestamps def starting_node_id - object.starting_node.to_global_id + object.starting_node&.to_global_id end end end diff --git a/app/graphql/types/function_definition_type.rb b/app/graphql/types/function_definition_type.rb index 791c35e8..ae117c5c 100644 --- a/app/graphql/types/function_definition_type.rb +++ b/app/graphql/types/function_definition_type.rb @@ -50,6 +50,10 @@ def generic_keys object.runtime_function_definition&.generic_keys end + def throws_error + object.runtime_function_definition&.throws_error + end + def data_type_identifiers DataTypeIdentifiersFinder.new({ function_definition: object, expand_recursively: true }).execute end diff --git a/app/graphql/types/input/flow_input_type.rb b/app/graphql/types/input/flow_input_type.rb index 2828cb66..321f5cf9 100644 --- a/app/graphql/types/input/flow_input_type.rb +++ b/app/graphql/types/input/flow_input_type.rb @@ -9,7 +9,7 @@ class FlowInputType < Types::BaseInputObject argument :settings, [Types::Input::FlowSettingInputType], required: false, description: 'The settings of the flow' - argument :starting_node_id, Types::GlobalIdType[::NodeFunction], required: true, + argument :starting_node_id, Types::GlobalIdType[::NodeFunction], required: false, description: 'The starting node of the flow' argument :nodes, [Types::Input::NodeFunctionInputType], required: true, diff --git a/docs/graphql/input_object/flowinput.md b/docs/graphql/input_object/flowinput.md index 98c8ae41..c1774a17 100644 --- a/docs/graphql/input_object/flowinput.md +++ b/docs/graphql/input_object/flowinput.md @@ -11,5 +11,5 @@ Input type for creating or updating a flow | `name` | [`String!`](../scalar/string.md) | The name of the flow | | `nodes` | [`[NodeFunctionInput!]!`](../input_object/nodefunctioninput.md) | The node functions of the flow | | `settings` | [`[FlowSettingInput!]`](../input_object/flowsettinginput.md) | The settings of the flow | -| `startingNodeId` | [`NodeFunctionID!`](../scalar/nodefunctionid.md) | The starting node of the flow | +| `startingNodeId` | [`NodeFunctionID`](../scalar/nodefunctionid.md) | The starting node of the flow | | `type` | [`FlowTypeID!`](../scalar/flowtypeid.md) | The identifier of the flow type | diff --git a/docs/graphql/object/flow.md b/docs/graphql/object/flow.md index 1388b486..0b71f669 100644 --- a/docs/graphql/object/flow.md +++ b/docs/graphql/object/flow.md @@ -16,7 +16,7 @@ Represents a flow | `project` | [`NamespaceProject!`](../object/namespaceproject.md) | The project the flow belongs to | | `returnType` | [`DataType`](../object/datatype.md) | The return data type of the flow | | `settings` | [`FlowSettingConnection!`](../object/flowsettingconnection.md) | The settings of the flow | -| `startingNodeId` | [`NodeFunctionID!`](../scalar/nodefunctionid.md) | The ID of the starting node of the flow | +| `startingNodeId` | [`NodeFunctionID`](../scalar/nodefunctionid.md) | The ID of the starting node of the flow | | `type` | [`FlowType!`](../object/flowtype.md) | The flow type of the flow | | `updatedAt` | [`Time!`](../scalar/time.md) | Time when this Flow was last updated | | `userAbilities` | [`FlowUserAbilities!`](../object/flowuserabilities.md) | Abilities for the current user on this Flow |