@@ -4,16 +4,35 @@ module Types
44 class NamespaceProjectType < Types ::BaseObject
55 description 'Represents a namespace project'
66
7- authorize :read_namespace_project
7+ field :flow , Types ::FlowType , null : true , description : 'Fetches an flow given by its ID' do
8+ argument :id , Types ::GlobalIdType [ ::Flow ] , required : true , description : 'Id of the flow'
9+ end
810
911 field :description , String , null : false , description : 'Description of the project'
12+
1013 field :name , String , null : false , description : 'Name of the project'
14+
1115 field :runtimes , Types ::RuntimeType . connection_type , null : false , description : 'Runtimes assigned to this project'
1216
1317 field :namespace , Types ::NamespaceType , null : false ,
1418 description : 'The namespace where this project belongs to'
19+
1520 field :primary_runtime , Types ::RuntimeType , null : true , description : 'The primary runtime for the project'
1621
22+ field :flows , Types ::FlowType . connection_type , null : true , description : 'Fetches all flows in this project'
23+
24+ def flows
25+ project = context . schema . object_from_id ( id , context )
26+
27+ project . flows
28+ end
29+
30+ def flow ( id :)
31+ context . schema . object_from_id ( id , context ) . flows . find ( id : id )
32+ end
33+
34+ authorize :read_namespace_project
35+
1736 id_field NamespaceProject
1837 timestamps
1938 end
0 commit comments