Skip to content
Open
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
2 changes: 1 addition & 1 deletion app/graphql/types/data_type_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Types
class DataTypeType < Types::BaseObject
description 'Represents a DataType'

authorize :read_datatype
authorize :read_data_type

field :aliases, Types::TranslationType.connection_type, null: true, description: 'Name of the function'
field :display_messages, Types::TranslationType.connection_type, null: true,
Expand Down
2 changes: 1 addition & 1 deletion app/graphql/types/runtime_function_definition_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Types
class RuntimeFunctionDefinitionType < Types::BaseObject
description 'Represents a runtime function definition'

authorize :read_flow
authorize :read_runtime_function_definition

field :runtime, Types::RuntimeType,
null: false, description: 'The runtime this runtime function definition belongs to'
Expand Down
7 changes: 6 additions & 1 deletion app/graphql/types/runtime_parameter_definition_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ module Types
class RuntimeParameterDefinitionType < Types::BaseObject
description 'Represents a runtime parameter definition'

authorize :read_flow
authorize :read_runtime_parameter_definition

field :identifier, String,
null: false,
description: 'Identifier of the runtime parameter definition',
method: :runtime_name

id_field RuntimeParameterDefinition
timestamps
Expand Down
3 changes: 3 additions & 0 deletions app/graphql/types/runtime_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class RuntimeType < Types::BaseObject
field :namespace, Types::NamespaceType, null: true, description: 'The parent namespace for the runtime'
field :projects, Types::NamespaceProjectType.connection_type, null: false,
description: 'Projects associated with the runtime'
field :runtime_function_definitions, Types::RuntimeFunctionDefinitionType.connection_type,
null: false,
description: 'Functions of the runtime'
field :status, Types::RuntimeStatusType, null: false, description: 'The status of the runtime'

field :token, String, null: true, description: 'Token belonging to the runtime, only present on creation'
Expand Down
5 changes: 5 additions & 0 deletions app/policies/runtime_parameter_definition_policy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

class RuntimeParameterDefinitionPolicy < BasePolicy
delegate { subject.runtime_function_definition }
end
6 changes: 6 additions & 0 deletions app/policies/runtime_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

class RuntimePolicy < BasePolicy
delegate { subject.namespace || :global }

rule { can?(:read_runtime) }.policy do
enable :read_data_type
enable :read_runtime_function_definition
enable :read_runtime_parameter_definition
end
end
1 change: 1 addition & 0 deletions docs/graphql/object/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Represents a runtime
| `name` | [`String!`](../scalar/string.md) | The name for the runtime |
| `namespace` | [`Namespace`](../object/namespace.md) | The parent namespace for the runtime |
| `projects` | [`NamespaceProjectConnection!`](../object/namespaceprojectconnection.md) | Projects associated with the runtime |
| `runtimeFunctionDefinitions` | [`RuntimeFunctionDefinitionConnection!`](../object/runtimefunctiondefinitionconnection.md) | Functions of the runtime |
| `status` | [`RuntimeStatusType!`](../enum/runtimestatustype.md) | The status of the runtime |
| `token` | [`String`](../scalar/string.md) | Token belonging to the runtime, only present on creation |
| `updatedAt` | [`Time!`](../scalar/time.md) | Time when this Runtime was last updated |
Expand Down
15 changes: 15 additions & 0 deletions docs/graphql/object/runtimefunctiondefinitionconnection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: RuntimeFunctionDefinitionConnection
---

The connection type for RuntimeFunctionDefinition.

## Fields without arguments

| Name | Type | Description |
|------|------|-------------|
| `count` | [`Int!`](../scalar/int.md) | Total count of collection. |
| `edges` | [`[RuntimeFunctionDefinitionEdge]`](../object/runtimefunctiondefinitionedge.md) | A list of edges. |
| `nodes` | [`[RuntimeFunctionDefinition]`](../object/runtimefunctiondefinition.md) | A list of nodes. |
| `pageInfo` | [`PageInfo!`](../object/pageinfo.md) | Information to aid in pagination. |

13 changes: 13 additions & 0 deletions docs/graphql/object/runtimefunctiondefinitionedge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: RuntimeFunctionDefinitionEdge
---

An edge in a connection.

## Fields without arguments

| Name | Type | Description |
|------|------|-------------|
| `cursor` | [`String!`](../scalar/string.md) | A cursor for use in pagination. |
| `node` | [`RuntimeFunctionDefinition`](../object/runtimefunctiondefinition.md) | The item at the end of the edge. |

1 change: 1 addition & 0 deletions docs/graphql/object/runtimeparameterdefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Represents a runtime parameter definition
|------|------|-------------|
| `createdAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeParameterDefinition was created |
| `id` | [`RuntimeParameterDefinitionID!`](../scalar/runtimeparameterdefinitionid.md) | Global ID of this RuntimeParameterDefinition |
| `identifier` | [`String!`](../scalar/string.md) | Identifier of the runtime parameter definition |
| `updatedAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeParameterDefinition was last updated |

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@

it { expect(described_class.graphql_name).to eq('RuntimeFunctionDefinition') }
it { expect(described_class).to have_graphql_fields(fields) }
it { expect(described_class).to require_graphql_authorizations(:read_flow) }
it { expect(described_class).to require_graphql_authorizations(:read_runtime_function_definition) }
end
3 changes: 2 additions & 1 deletion spec/graphql/types/runtime_parameter_definition_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
let(:fields) do
%w[
id
identifier
createdAt
updatedAt
]
end

it { expect(described_class.graphql_name).to eq('RuntimeParameterDefinition') }
it { expect(described_class).to have_graphql_fields(fields) }
it { expect(described_class).to require_graphql_authorizations(:read_flow) }
it { expect(described_class).to require_graphql_authorizations(:read_runtime_parameter_definition) }
end
1 change: 1 addition & 0 deletions spec/graphql/types/runtime_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
name
dataTypes
flowTypes
runtimeFunctionDefinitions
description
projects
status
Expand Down