Skip to content

Commit 92f51ca

Browse files
authored
Merge pull request #831 from code0-tech/more-fixes
Fix more graphql types
2 parents e81f09e + 97ebac2 commit 92f51ca

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

app/graphql/types/flow_type.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FlowType < Types::BaseObject
2222
method: :flow_settings,
2323
description: 'The settings of the flow'
2424
field :starting_node_id, Types::GlobalIdType[::NodeFunction],
25-
null: false,
25+
null: true,
2626
description: 'The ID of the starting node of the flow'
2727
field :type, Types::FlowTypeType,
2828
null: false,
@@ -41,7 +41,7 @@ class FlowType < Types::BaseObject
4141
timestamps
4242

4343
def starting_node_id
44-
object.starting_node.to_global_id
44+
object.starting_node&.to_global_id
4545
end
4646
end
4747
end

app/graphql/types/function_definition_type.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def generic_keys
5050
object.runtime_function_definition&.generic_keys
5151
end
5252

53+
def throws_error
54+
object.runtime_function_definition&.throws_error
55+
end
56+
5357
def data_type_identifiers
5458
DataTypeIdentifiersFinder.new({ function_definition: object, expand_recursively: true }).execute
5559
end

app/graphql/types/input/flow_input_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class FlowInputType < Types::BaseInputObject
99

1010
argument :settings, [Types::Input::FlowSettingInputType], required: false,
1111
description: 'The settings of the flow'
12-
argument :starting_node_id, Types::GlobalIdType[::NodeFunction], required: true,
12+
argument :starting_node_id, Types::GlobalIdType[::NodeFunction], required: false,
1313
description: 'The starting node of the flow'
1414

1515
argument :nodes, [Types::Input::NodeFunctionInputType], required: true,

docs/graphql/input_object/flowinput.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ Input type for creating or updating a flow
1111
| `name` | [`String!`](../scalar/string.md) | The name of the flow |
1212
| `nodes` | [`[NodeFunctionInput!]!`](../input_object/nodefunctioninput.md) | The node functions of the flow |
1313
| `settings` | [`[FlowSettingInput!]`](../input_object/flowsettinginput.md) | The settings of the flow |
14-
| `startingNodeId` | [`NodeFunctionID!`](../scalar/nodefunctionid.md) | The starting node of the flow |
14+
| `startingNodeId` | [`NodeFunctionID`](../scalar/nodefunctionid.md) | The starting node of the flow |
1515
| `type` | [`FlowTypeID!`](../scalar/flowtypeid.md) | The identifier of the flow type |

docs/graphql/object/flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Represents a flow
1616
| `project` | [`NamespaceProject!`](../object/namespaceproject.md) | The project the flow belongs to |
1717
| `returnType` | [`DataType`](../object/datatype.md) | The return data type of the flow |
1818
| `settings` | [`FlowSettingConnection!`](../object/flowsettingconnection.md) | The settings of the flow |
19-
| `startingNodeId` | [`NodeFunctionID!`](../scalar/nodefunctionid.md) | The ID of the starting node of the flow |
19+
| `startingNodeId` | [`NodeFunctionID`](../scalar/nodefunctionid.md) | The ID of the starting node of the flow |
2020
| `type` | [`FlowType!`](../object/flowtype.md) | The flow type of the flow |
2121
| `updatedAt` | [`Time!`](../scalar/time.md) | Time when this Flow was last updated |
2222
| `userAbilities` | [`FlowUserAbilities!`](../object/flowuserabilities.md) | Abilities for the current user on this Flow |

0 commit comments

Comments
 (0)