Commit bdff54a2 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '336292-convert-old-graphql-types-to-newer-type-names-4' into 'master'

Convert old GraphQL types to newer type names (Part 4) [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!66495
parents 398e4a87 01ea8178
...@@ -28,55 +28,6 @@ Graphql/OldTypes: ...@@ -28,55 +28,6 @@ Graphql/OldTypes:
Exclude: Exclude:
- 'spec/**/*.rb' - 'spec/**/*.rb'
- 'ee/spec/**/*.rb' - 'ee/spec/**/*.rb'
- 'app/graphql/types/access_level_type.rb'
- 'app/graphql/types/admin/analytics/usage_trends/measurement_type.rb'
- 'app/graphql/types/admin/sidekiq_queues/delete_jobs_response_type.rb'
- 'app/graphql/types/alert_management/alert_status_counts_type.rb'
- 'app/graphql/types/alert_management/alert_type.rb'
- 'app/graphql/types/alert_management/integration_type.rb'
- 'app/graphql/types/award_emojis/award_emoji_type.rb'
- 'app/graphql/types/blob_viewer_type.rb'
- 'app/graphql/types/board_list_type.rb'
- 'app/graphql/types/board_type.rb'
- 'app/graphql/types/boards/board_issuable_input_base_type.rb'
- 'app/graphql/types/boards/board_issue_input_base_type.rb'
- 'app/graphql/types/boards/board_issue_input_type.rb'
- 'app/graphql/types/branch_type.rb'
- 'app/graphql/types/ci/application_setting_type.rb'
- 'app/graphql/types/ci/build_need_type.rb'
- 'app/graphql/types/ci/ci_cd_setting_type.rb'
- 'app/graphql/types/ci/config/config_type.rb'
- 'app/graphql/types/ci/config/group_type.rb'
- 'app/graphql/types/ci/config/job_type.rb'
- 'app/graphql/types/ci/config/need_type.rb'
- 'app/graphql/types/ci/config/stage_type.rb'
- 'app/graphql/types/ci/detailed_status_type.rb'
- 'app/graphql/types/ci/group_type.rb'
- 'app/graphql/types/ci/job_artifact_type.rb'
- 'app/graphql/types/ci/job_type.rb'
- 'app/graphql/types/ci/pipeline_type.rb'
- 'app/graphql/types/ci/recent_failures_type.rb'
- 'app/graphql/types/ci/runner_architecture_type.rb'
- 'app/graphql/types/ci/runner_platform_type.rb'
- 'app/graphql/types/ci/runner_setup_type.rb'
- 'app/graphql/types/ci/runner_type.rb'
- 'app/graphql/types/ci/stage_type.rb'
- 'app/graphql/types/ci/status_action_type.rb'
- 'app/graphql/types/ci/template_type.rb'
- 'app/graphql/types/ci/test_case_type.rb'
- 'app/graphql/types/ci/test_report_total_type.rb'
- 'app/graphql/types/ci/test_suite_summary_type.rb'
- 'app/graphql/types/ci/test_suite_type.rb'
- 'app/graphql/types/ci_configuration/sast/analyzers_entity_input_type.rb'
- 'app/graphql/types/ci_configuration/sast/analyzers_entity_type.rb'
- 'app/graphql/types/ci_configuration/sast/entity_input_type.rb'
- 'app/graphql/types/ci_configuration/sast/entity_type.rb'
- 'app/graphql/types/ci_configuration/sast/options_entity_type.rb'
- 'app/graphql/types/container_expiration_policy_type.rb'
- 'app/graphql/types/container_repository_tag_type.rb'
- 'app/graphql/types/container_repository_type.rb'
- 'app/graphql/types/countable_connection_type.rb'
- 'app/graphql/types/custom_emoji_type.rb'
- 'ee/app/graphql/ee/mutations/ci/ci_cd_settings_update.rb' - 'ee/app/graphql/ee/mutations/ci/ci_cd_settings_update.rb'
- 'ee/app/graphql/ee/resolvers/issues_resolver.rb' - 'ee/app/graphql/ee/resolvers/issues_resolver.rb'
- 'ee/app/graphql/ee/resolvers/namespace_projects_resolver.rb' - 'ee/app/graphql/ee/resolvers/namespace_projects_resolver.rb'
......
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
graphql_name 'AccessLevel' graphql_name 'AccessLevel'
description 'Represents the access level of a relationship between a User and object that it is related to' description 'Represents the access level of a relationship between a User and object that it is related to'
field :integer_value, GraphQL::INT_TYPE, null: true, field :integer_value, GraphQL::Types::Int, null: true,
description: 'Integer representation of access level.', description: 'Integer representation of access level.',
method: :to_i method: :to_i
......
...@@ -14,7 +14,7 @@ module Types ...@@ -14,7 +14,7 @@ module Types
field :recorded_at, Types::TimeType, null: true, field :recorded_at, Types::TimeType, null: true,
description: 'The time the measurement was recorded.' description: 'The time the measurement was recorded.'
field :count, GraphQL::INT_TYPE, null: false, field :count, GraphQL::Types::Int, null: false,
description: 'Object count.' description: 'Object count.'
field :identifier, Types::Admin::Analytics::UsageTrends::MeasurementIdentifierEnum, null: false, field :identifier, Types::Admin::Analytics::UsageTrends::MeasurementIdentifierEnum, null: false,
......
...@@ -10,17 +10,17 @@ module Types ...@@ -10,17 +10,17 @@ module Types
description 'The response from the AdminSidekiqQueuesDeleteJobs mutation' description 'The response from the AdminSidekiqQueuesDeleteJobs mutation'
field :completed, field :completed,
GraphQL::BOOLEAN_TYPE, GraphQL::Types::Boolean,
null: true, null: true,
description: 'Whether or not the entire queue was processed in time; if not, retrying the same request is safe.' description: 'Whether or not the entire queue was processed in time; if not, retrying the same request is safe.'
field :deleted_jobs, field :deleted_jobs,
GraphQL::INT_TYPE, GraphQL::Types::Int,
null: true, null: true,
description: 'The number of matching jobs deleted.' description: 'The number of matching jobs deleted.'
field :queue_size, field :queue_size,
GraphQL::INT_TYPE, GraphQL::Types::Int,
null: true, null: true,
description: 'The queue size after processing.' description: 'The queue size after processing.'
end end
......
...@@ -11,18 +11,18 @@ module Types ...@@ -11,18 +11,18 @@ module Types
::AlertManagement::Alert.status_names.each do |status| ::AlertManagement::Alert.status_names.each do |status|
field status, field status,
GraphQL::INT_TYPE, GraphQL::Types::Int,
null: true, null: true,
description: "Number of alerts with status #{status.to_s.upcase} for the project" description: "Number of alerts with status #{status.to_s.upcase} for the project"
end end
field :open, field :open,
GraphQL::INT_TYPE, GraphQL::Types::Int,
null: true, null: true,
description: 'Number of alerts with status TRIGGERED or ACKNOWLEDGED for the project.' description: 'Number of alerts with status TRIGGERED or ACKNOWLEDGED for the project.'
field :all, field :all,
GraphQL::INT_TYPE, GraphQL::Types::Int,
null: true, null: true,
description: 'Total number of alerts for the project.' description: 'Total number of alerts for the project.'
end end
......
...@@ -13,12 +13,12 @@ module Types ...@@ -13,12 +13,12 @@ module Types
authorize :read_alert_management_alert authorize :read_alert_management_alert
field :iid, field :iid,
GraphQL::ID_TYPE, GraphQL::Types::ID,
null: false, null: false,
description: 'Internal ID of the alert.' description: 'Internal ID of the alert.'
field :issue_iid, field :issue_iid,
GraphQL::ID_TYPE, GraphQL::Types::ID,
null: true, null: true,
deprecated: { reason: 'Use issue field', milestone: '13.10' }, deprecated: { reason: 'Use issue field', milestone: '13.10' },
description: 'Internal ID of the GitLab issue attached to the alert.' description: 'Internal ID of the GitLab issue attached to the alert.'
...@@ -29,12 +29,12 @@ module Types ...@@ -29,12 +29,12 @@ module Types
description: 'Issue attached to the alert.' description: 'Issue attached to the alert.'
field :title, field :title,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Title of the alert.' description: 'Title of the alert.'
field :description, field :description,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Description of the alert.' description: 'Description of the alert.'
...@@ -50,17 +50,17 @@ module Types ...@@ -50,17 +50,17 @@ module Types
method: :status_name method: :status_name
field :service, field :service,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Service the alert came from.' description: 'Service the alert came from.'
field :monitoring_tool, field :monitoring_tool,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Monitoring tool the alert came from.' description: 'Monitoring tool the alert came from.'
field :hosts, field :hosts,
[GraphQL::STRING_TYPE], [GraphQL::Types::String],
null: true, null: true,
description: 'List of hosts the alert came from.' description: 'List of hosts the alert came from.'
...@@ -80,7 +80,7 @@ module Types ...@@ -80,7 +80,7 @@ module Types
description: 'Environment for the alert.' description: 'Environment for the alert.'
field :event_count, field :event_count,
GraphQL::INT_TYPE, GraphQL::Types::Int,
null: true, null: true,
description: 'Number of events of this alert.', description: 'Number of events of this alert.',
method: :events method: :events
...@@ -106,12 +106,12 @@ module Types ...@@ -106,12 +106,12 @@ module Types
description: 'Assignees of the alert.' description: 'Assignees of the alert.'
field :metrics_dashboard_url, field :metrics_dashboard_url,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'URL for metrics embed for the alert.' description: 'URL for metrics embed for the alert.'
field :runbook, field :runbook,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Runbook for the alert as defined in alert details.' description: 'Runbook for the alert as defined in alert details.'
...@@ -122,7 +122,7 @@ module Types ...@@ -122,7 +122,7 @@ module Types
resolver: Resolvers::TodoResolver resolver: Resolvers::TodoResolver
field :details_url, field :details_url,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: false, null: false,
description: 'The URL of the alert detail page.' description: 'The URL of the alert detail page.'
......
...@@ -7,7 +7,7 @@ module Types ...@@ -7,7 +7,7 @@ module Types
graphql_name 'AlertManagementIntegration' graphql_name 'AlertManagementIntegration'
field :id, field :id,
GraphQL::ID_TYPE, GraphQL::Types::ID,
null: false, null: false,
description: 'ID of the integration.' description: 'ID of the integration.'
...@@ -17,27 +17,27 @@ module Types ...@@ -17,27 +17,27 @@ module Types
description: 'Type of integration.' description: 'Type of integration.'
field :name, field :name,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Name of the integration.' description: 'Name of the integration.'
field :active, field :active,
GraphQL::BOOLEAN_TYPE, GraphQL::Types::Boolean,
null: true, null: true,
description: 'Whether the endpoint is currently accepting alerts.' description: 'Whether the endpoint is currently accepting alerts.'
field :token, field :token,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Token used to authenticate alert notification requests.' description: 'Token used to authenticate alert notification requests.'
field :url, field :url,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Endpoint which accepts alert notifications.' description: 'Endpoint which accepts alert notifications.'
field :api_url, field :api_url,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'URL at which Prometheus metrics can be queried to populate the metrics dashboard.' description: 'URL at which Prometheus metrics can be queried to populate the metrics dashboard.'
......
...@@ -11,27 +11,27 @@ module Types ...@@ -11,27 +11,27 @@ module Types
present_using AwardEmojiPresenter present_using AwardEmojiPresenter
field :name, field :name,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: false, null: false,
description: 'The emoji name.' description: 'The emoji name.'
field :description, field :description,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: false, null: false,
description: 'The emoji description.' description: 'The emoji description.'
field :unicode, field :unicode,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: false, null: false,
description: 'The emoji in Unicode.' description: 'The emoji in Unicode.'
field :emoji, field :emoji,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: false, null: false,
description: 'The emoji as an icon.' description: 'The emoji as an icon.'
field :unicode_version, field :unicode_version,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: false, null: false,
description: 'The Unicode version for this emoji.' description: 'The Unicode version for this emoji.'
......
...@@ -9,30 +9,30 @@ module Types ...@@ -9,30 +9,30 @@ module Types
description: 'Type of blob viewer.', description: 'Type of blob viewer.',
null: false null: false
field :load_async, GraphQL::BOOLEAN_TYPE, field :load_async, GraphQL::Types::Boolean,
description: 'Shows whether the blob content is loaded asynchronously.', description: 'Shows whether the blob content is loaded asynchronously.',
null: false null: false
field :collapsed, GraphQL::BOOLEAN_TYPE, field :collapsed, GraphQL::Types::Boolean,
description: 'Shows whether the blob should be displayed collapsed.', description: 'Shows whether the blob should be displayed collapsed.',
method: :collapsed?, method: :collapsed?,
null: false null: false
field :too_large, GraphQL::BOOLEAN_TYPE, field :too_large, GraphQL::Types::Boolean,
description: 'Shows whether the blob is too large to be displayed.', description: 'Shows whether the blob is too large to be displayed.',
method: :too_large?, method: :too_large?,
null: false null: false
field :render_error, GraphQL::STRING_TYPE, field :render_error, GraphQL::Types::String,
description: 'Error rendering the blob content.', description: 'Error rendering the blob content.',
null: true null: true
field :file_type, GraphQL::STRING_TYPE, field :file_type, GraphQL::Types::String,
description: 'Content file type.', description: 'Content file type.',
method: :partial_name, method: :partial_name,
null: false null: false
field :loading_partial_name, GraphQL::STRING_TYPE, field :loading_partial_name, GraphQL::Types::String,
description: 'Loading partial name.', description: 'Loading partial name.',
null: false null: false
......
...@@ -10,19 +10,19 @@ module Types ...@@ -10,19 +10,19 @@ module Types
alias_method :list, :object alias_method :list, :object
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID (global ID) of the list.' description: 'ID (global ID) of the list.'
field :title, GraphQL::STRING_TYPE, null: false, field :title, GraphQL::Types::String, null: false,
description: 'Title of the list.' description: 'Title of the list.'
field :list_type, GraphQL::STRING_TYPE, null: false, field :list_type, GraphQL::Types::String, null: false,
description: 'Type of the list.' description: 'Type of the list.'
field :position, GraphQL::INT_TYPE, null: true, field :position, GraphQL::Types::Int, null: true,
description: 'Position of list within the board.' description: 'Position of list within the board.'
field :label, Types::LabelType, null: true, field :label, Types::LabelType, null: true,
description: 'Label of the list.' description: 'Label of the list.'
field :collapsed, GraphQL::BOOLEAN_TYPE, null: true, field :collapsed, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the list is collapsed for this user.' description: 'Indicates if the list is collapsed for this user.'
field :issues_count, GraphQL::INT_TYPE, null: true, field :issues_count, GraphQL::Types::Int, null: true,
description: 'Count of issues in the list.' description: 'Count of issues in the list.'
field :issues, ::Types::IssueType.connection_type, null: true, field :issues, ::Types::IssueType.connection_type, null: true,
......
...@@ -9,15 +9,15 @@ module Types ...@@ -9,15 +9,15 @@ module Types
present_using BoardPresenter present_using BoardPresenter
field :id, type: GraphQL::ID_TYPE, null: false, field :id, type: GraphQL::Types::ID, null: false,
description: 'ID (global ID) of the board.' description: 'ID (global ID) of the board.'
field :name, type: GraphQL::STRING_TYPE, null: true, field :name, type: GraphQL::Types::String, null: true,
description: 'Name of the board.' description: 'Name of the board.'
field :hide_backlog_list, type: GraphQL::BOOLEAN_TYPE, null: true, field :hide_backlog_list, type: GraphQL::Types::Boolean, null: true,
description: 'Whether or not backlog list is hidden.' description: 'Whether or not backlog list is hidden.'
field :hide_closed_list, type: GraphQL::BOOLEAN_TYPE, null: true, field :hide_closed_list, type: GraphQL::Types::Boolean, null: true,
description: 'Whether or not closed list is hidden.' description: 'Whether or not closed list is hidden.'
field :created_at, Types::TimeType, null: false, field :created_at, Types::TimeType, null: false,
...@@ -33,10 +33,10 @@ module Types ...@@ -33,10 +33,10 @@ module Types
resolver: Resolvers::BoardListsResolver, resolver: Resolvers::BoardListsResolver,
extras: [:lookahead] extras: [:lookahead]
field :web_path, GraphQL::STRING_TYPE, null: false, field :web_path, GraphQL::Types::String, null: false,
description: 'Web path of the board.' description: 'Web path of the board.'
field :web_url, GraphQL::STRING_TYPE, null: false, field :web_url, GraphQL::Types::String, null: false,
description: 'Web URL of the board.' description: 'Web URL of the board.'
end end
end end
......
...@@ -4,15 +4,15 @@ module Types ...@@ -4,15 +4,15 @@ module Types
module Boards module Boards
# Common arguments that we can be used to filter boards epics and issues # Common arguments that we can be used to filter boards epics and issues
class BoardIssuableInputBaseType < BaseInputObject class BoardIssuableInputBaseType < BaseInputObject
argument :label_name, [GraphQL::STRING_TYPE, null: true], argument :label_name, [GraphQL::Types::String, null: true],
required: false, required: false,
description: 'Filter by label name.' description: 'Filter by label name.'
argument :author_username, GraphQL::STRING_TYPE, argument :author_username, GraphQL::Types::String,
required: false, required: false,
description: 'Filter by author username.' description: 'Filter by author username.'
argument :my_reaction_emoji, GraphQL::STRING_TYPE, argument :my_reaction_emoji, GraphQL::Types::String,
required: false, required: false,
description: 'Filter by reaction emoji applied by the current user.' description: 'Filter by reaction emoji applied by the current user.'
end end
......
...@@ -4,19 +4,19 @@ module Types ...@@ -4,19 +4,19 @@ module Types
module Boards module Boards
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class BoardIssueInputBaseType < BoardIssuableInputBaseType class BoardIssueInputBaseType < BoardIssuableInputBaseType
argument :iids, [GraphQL::STRING_TYPE], argument :iids, [GraphQL::Types::String],
required: false, required: false,
description: 'List of IIDs of issues. For example `["1", "2"]`.' description: 'List of IIDs of issues. For example `["1", "2"]`.'
argument :milestone_title, GraphQL::STRING_TYPE, argument :milestone_title, GraphQL::Types::String,
required: false, required: false,
description: 'Filter by milestone title.' description: 'Filter by milestone title.'
argument :assignee_username, [GraphQL::STRING_TYPE, null: true], argument :assignee_username, [GraphQL::Types::String, null: true],
required: false, required: false,
description: 'Filter by assignee username.' description: 'Filter by assignee username.'
argument :release_tag, GraphQL::STRING_TYPE, argument :release_tag, GraphQL::Types::String,
required: false, required: false,
description: 'Filter by release tag.' description: 'Filter by release tag.'
end end
......
...@@ -10,7 +10,7 @@ module Types ...@@ -10,7 +10,7 @@ module Types
prepare: ->(negated_args, ctx) { negated_args.to_h }, prepare: ->(negated_args, ctx) { negated_args.to_h },
description: 'List of negated arguments.' description: 'List of negated arguments.'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query for issue title or description.' description: 'Search query for issue title or description.'
......
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
graphql_name 'Branch' graphql_name 'Branch'
field :name, field :name,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: false, null: false,
description: 'Name of the branch.' description: 'Name of the branch.'
......
...@@ -6,27 +6,27 @@ module Types ...@@ -6,27 +6,27 @@ module Types
class AnalyticsType < BaseObject class AnalyticsType < BaseObject
graphql_name 'PipelineAnalytics' graphql_name 'PipelineAnalytics'
field :week_pipelines_totals, [GraphQL::INT_TYPE], null: true, field :week_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total weekly pipeline count.' description: 'Total weekly pipeline count.'
field :week_pipelines_successful, [GraphQL::INT_TYPE], null: true, field :week_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total weekly successful pipeline count.' description: 'Total weekly successful pipeline count.'
field :week_pipelines_labels, [GraphQL::STRING_TYPE], null: true, field :week_pipelines_labels, [GraphQL::Types::String], null: true,
description: 'Labels for the weekly pipeline count.' description: 'Labels for the weekly pipeline count.'
field :month_pipelines_totals, [GraphQL::INT_TYPE], null: true, field :month_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total monthly pipeline count.' description: 'Total monthly pipeline count.'
field :month_pipelines_successful, [GraphQL::INT_TYPE], null: true, field :month_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total monthly successful pipeline count.' description: 'Total monthly successful pipeline count.'
field :month_pipelines_labels, [GraphQL::STRING_TYPE], null: true, field :month_pipelines_labels, [GraphQL::Types::String], null: true,
description: 'Labels for the monthly pipeline count.' description: 'Labels for the monthly pipeline count.'
field :year_pipelines_totals, [GraphQL::INT_TYPE], null: true, field :year_pipelines_totals, [GraphQL::Types::Int], null: true,
description: 'Total yearly pipeline count.' description: 'Total yearly pipeline count.'
field :year_pipelines_successful, [GraphQL::INT_TYPE], null: true, field :year_pipelines_successful, [GraphQL::Types::Int], null: true,
description: 'Total yearly successful pipeline count.' description: 'Total yearly successful pipeline count.'
field :year_pipelines_labels, [GraphQL::STRING_TYPE], null: true, field :year_pipelines_labels, [GraphQL::Types::String], null: true,
description: 'Labels for the yearly pipeline count.' description: 'Labels for the yearly pipeline count.'
field :pipeline_times_values, [GraphQL::INT_TYPE], null: true, field :pipeline_times_values, [GraphQL::Types::Int], null: true,
description: 'Pipeline times.' description: 'Pipeline times.'
field :pipeline_times_labels, [GraphQL::STRING_TYPE], null: true, field :pipeline_times_labels, [GraphQL::Types::String], null: true,
description: 'Pipeline times labels.' description: 'Pipeline times labels.'
end end
end end
......
...@@ -7,7 +7,7 @@ module Types ...@@ -7,7 +7,7 @@ module Types
authorize :read_application_setting authorize :read_application_setting
field :keep_latest_artifact, GraphQL::BOOLEAN_TYPE, null: true, field :keep_latest_artifact, GraphQL::Types::Boolean, null: true,
description: 'Whether to keep the latest jobs artifacts.' description: 'Whether to keep the latest jobs artifacts.'
end end
end end
......
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
class BuildNeedType < BaseObject class BuildNeedType < BaseObject
graphql_name 'CiBuildNeed' graphql_name 'CiBuildNeed'
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the job we need to complete.' description: 'ID of the job we need to complete.'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the job we need to complete.' description: 'Name of the job we need to complete.'
end end
end end
......
...@@ -7,16 +7,16 @@ module Types ...@@ -7,16 +7,16 @@ module Types
authorize :admin_project authorize :admin_project
field :merge_pipelines_enabled, GraphQL::BOOLEAN_TYPE, null: true, field :merge_pipelines_enabled, GraphQL::Types::Boolean, null: true,
description: 'Whether merge pipelines are enabled.', description: 'Whether merge pipelines are enabled.',
method: :merge_pipelines_enabled? method: :merge_pipelines_enabled?
field :merge_trains_enabled, GraphQL::BOOLEAN_TYPE, null: true, field :merge_trains_enabled, GraphQL::Types::Boolean, null: true,
description: 'Whether merge trains are enabled.', description: 'Whether merge trains are enabled.',
method: :merge_trains_enabled? method: :merge_trains_enabled?
field :keep_latest_artifact, GraphQL::BOOLEAN_TYPE, null: true, field :keep_latest_artifact, GraphQL::Types::Boolean, null: true,
description: 'Whether to keep the latest builds artifacts.', description: 'Whether to keep the latest builds artifacts.',
method: :keep_latest_artifacts_available? method: :keep_latest_artifacts_available?
field :job_token_scope_enabled, GraphQL::BOOLEAN_TYPE, null: true, field :job_token_scope_enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates CI job tokens generated in this project have restricted access to resources.', description: 'Indicates CI job tokens generated in this project have restricted access to resources.',
method: :job_token_scope_enabled? method: :job_token_scope_enabled?
field :project, Types::ProjectType, null: true, field :project, Types::ProjectType, null: true,
......
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
class ConfigType < BaseObject class ConfigType < BaseObject
graphql_name 'CiConfig' graphql_name 'CiConfig'
field :errors, [GraphQL::STRING_TYPE], null: true, field :errors, [GraphQL::Types::String], null: true,
description: 'Linting errors.' description: 'Linting errors.'
field :merged_yaml, GraphQL::STRING_TYPE, null: true, field :merged_yaml, GraphQL::Types::String, null: true,
description: 'Merged CI configuration YAML.' description: 'Merged CI configuration YAML.'
field :stages, Types::Ci::Config::StageType.connection_type, null: true, field :stages, Types::Ci::Config::StageType.connection_type, null: true,
description: 'Stages of the pipeline.' description: 'Stages of the pipeline.'
......
...@@ -7,11 +7,11 @@ module Types ...@@ -7,11 +7,11 @@ module Types
class GroupType < BaseObject class GroupType < BaseObject
graphql_name 'CiConfigGroup' graphql_name 'CiConfigGroup'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the job group.' description: 'Name of the job group.'
field :jobs, Types::Ci::Config::JobType.connection_type, null: true, field :jobs, Types::Ci::Config::JobType.connection_type, null: true,
description: 'Jobs in group.' description: 'Jobs in group.'
field :size, GraphQL::INT_TYPE, null: true, field :size, GraphQL::Types::Int, null: true,
description: 'Size of the job group.' description: 'Size of the job group.'
end end
end end
......
...@@ -7,7 +7,7 @@ module Types ...@@ -7,7 +7,7 @@ module Types
class JobRestrictionType < BaseObject class JobRestrictionType < BaseObject
graphql_name 'CiConfigJobRestriction' graphql_name 'CiConfigJobRestriction'
field :refs, [GraphQL::STRING_TYPE], null: true, field :refs, [GraphQL::Types::String], null: true,
description: 'The Git refs the job restriction applies to.' description: 'The Git refs the job restriction applies to.'
end end
end end
......
...@@ -7,32 +7,32 @@ module Types ...@@ -7,32 +7,32 @@ module Types
class JobType < BaseObject class JobType < BaseObject
graphql_name 'CiConfigJob' graphql_name 'CiConfigJob'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the job.' description: 'Name of the job.'
field :group_name, GraphQL::STRING_TYPE, null: true, field :group_name, GraphQL::Types::String, null: true,
description: 'Name of the job group.' description: 'Name of the job group.'
field :stage, GraphQL::STRING_TYPE, null: true, field :stage, GraphQL::Types::String, null: true,
description: 'Name of the job stage.' description: 'Name of the job stage.'
field :needs, Types::Ci::Config::NeedType.connection_type, null: true, field :needs, Types::Ci::Config::NeedType.connection_type, null: true,
description: 'Builds that must complete before the jobs run.' description: 'Builds that must complete before the jobs run.'
field :allow_failure, GraphQL::BOOLEAN_TYPE, null: true, field :allow_failure, GraphQL::Types::Boolean, null: true,
description: 'Allow job to fail.' description: 'Allow job to fail.'
field :before_script, [GraphQL::STRING_TYPE], null: true, field :before_script, [GraphQL::Types::String], null: true,
description: 'Override a set of commands that are executed before the job.' description: 'Override a set of commands that are executed before the job.'
field :script, [GraphQL::STRING_TYPE], null: true, field :script, [GraphQL::Types::String], null: true,
description: 'Shell script that is executed by a runner.' description: 'Shell script that is executed by a runner.'
field :after_script, [GraphQL::STRING_TYPE], null: true, field :after_script, [GraphQL::Types::String], null: true,
description: 'Override a set of commands that are executed after the job.' description: 'Override a set of commands that are executed after the job.'
field :when, GraphQL::STRING_TYPE, null: true, field :when, GraphQL::Types::String, null: true,
description: 'When to run the job.', description: 'When to run the job.',
resolver_method: :restrict_when_to_run_jobs resolver_method: :restrict_when_to_run_jobs
field :environment, GraphQL::STRING_TYPE, null: true, field :environment, GraphQL::Types::String, null: true,
description: 'Name of an environment to which the job deploys.' description: 'Name of an environment to which the job deploys.'
field :except, Types::Ci::Config::JobRestrictionType, null: true, field :except, Types::Ci::Config::JobRestrictionType, null: true,
description: 'Limit when jobs are not created.' description: 'Limit when jobs are not created.'
field :only, Types::Ci::Config::JobRestrictionType, null: true, field :only, Types::Ci::Config::JobRestrictionType, null: true,
description: 'Jobs are created when these conditions do not apply.' description: 'Jobs are created when these conditions do not apply.'
field :tags, [GraphQL::STRING_TYPE], null: true, field :tags, [GraphQL::Types::String], null: true,
description: 'List of tags that are used to select a runner.' description: 'List of tags that are used to select a runner.'
def restrict_when_to_run_jobs def restrict_when_to_run_jobs
......
...@@ -7,7 +7,7 @@ module Types ...@@ -7,7 +7,7 @@ module Types
class NeedType < BaseObject class NeedType < BaseObject
graphql_name 'CiConfigNeed' graphql_name 'CiConfigNeed'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the need.' description: 'Name of the need.'
end end
end end
......
...@@ -7,7 +7,7 @@ module Types ...@@ -7,7 +7,7 @@ module Types
class StageType < BaseObject class StageType < BaseObject
graphql_name 'CiConfigStage' graphql_name 'CiConfigStage'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the stage.' description: 'Name of the stage.'
field :groups, Types::Ci::Config::GroupType.connection_type, null: true, field :groups, Types::Ci::Config::GroupType.connection_type, null: true,
description: 'Groups of jobs for the stage.' description: 'Groups of jobs for the stage.'
......
...@@ -6,26 +6,26 @@ module Types ...@@ -6,26 +6,26 @@ module Types
class DetailedStatusType < BaseObject class DetailedStatusType < BaseObject
graphql_name 'DetailedStatus' graphql_name 'DetailedStatus'
field :id, GraphQL::STRING_TYPE, null: false, field :id, GraphQL::Types::String, null: false,
description: 'ID for a detailed status.', description: 'ID for a detailed status.',
extras: [:parent] extras: [:parent]
field :group, GraphQL::STRING_TYPE, null: true, field :group, GraphQL::Types::String, null: true,
description: 'Group of the status.' description: 'Group of the status.'
field :icon, GraphQL::STRING_TYPE, null: true, field :icon, GraphQL::Types::String, null: true,
description: 'Icon of the status.' description: 'Icon of the status.'
field :favicon, GraphQL::STRING_TYPE, null: true, field :favicon, GraphQL::Types::String, null: true,
description: 'Favicon of the status.' description: 'Favicon of the status.'
field :details_path, GraphQL::STRING_TYPE, null: true, field :details_path, GraphQL::Types::String, null: true,
description: 'Path of the details for the status.' description: 'Path of the details for the status.'
field :has_details, GraphQL::BOOLEAN_TYPE, null: true, field :has_details, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the status has further details.', description: 'Indicates if the status has further details.',
method: :has_details? method: :has_details?
field :label, GraphQL::STRING_TYPE, null: true, field :label, GraphQL::Types::String, null: true,
calls_gitaly: true, calls_gitaly: true,
description: 'Label of the status.' description: 'Label of the status.'
field :text, GraphQL::STRING_TYPE, null: true, field :text, GraphQL::Types::String, null: true,
description: 'Text of the status.' description: 'Text of the status.'
field :tooltip, GraphQL::STRING_TYPE, null: true, field :tooltip, GraphQL::Types::String, null: true,
description: 'Tooltip associated with the status.', description: 'Tooltip associated with the status.',
method: :status_tooltip method: :status_tooltip
field :action, Types::Ci::StatusActionType, null: true, field :action, Types::Ci::StatusActionType, null: true,
......
...@@ -6,11 +6,11 @@ module Types ...@@ -6,11 +6,11 @@ module Types
class GroupType < BaseObject class GroupType < BaseObject
graphql_name 'CiGroup' graphql_name 'CiGroup'
field :id, GraphQL::STRING_TYPE, null: false, field :id, GraphQL::Types::String, null: false,
description: 'ID for a group.' description: 'ID for a group.'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the job group.' description: 'Name of the job group.'
field :size, GraphQL::INT_TYPE, null: true, field :size, GraphQL::Types::Int, null: true,
description: 'Size of the group.' description: 'Size of the group.'
field :jobs, Ci::JobType.connection_type, null: true, field :jobs, Ci::JobType.connection_type, null: true,
description: 'Jobs in group.' description: 'Jobs in group.'
......
...@@ -6,7 +6,7 @@ module Types ...@@ -6,7 +6,7 @@ module Types
class JobArtifactType < BaseObject class JobArtifactType < BaseObject
graphql_name 'CiJobArtifact' graphql_name 'CiJobArtifact'
field :download_path, GraphQL::STRING_TYPE, null: true, field :download_path, GraphQL::Types::String, null: true,
description: "URL for downloading the artifact's file." description: "URL for downloading the artifact's file."
field :file_type, ::Types::Ci::JobArtifactFileTypeEnum, null: true, field :file_type, ::Types::Ci::JobArtifactFileTypeEnum, null: true,
......
...@@ -14,7 +14,7 @@ module Types ...@@ -14,7 +14,7 @@ module Types
description: 'ID of the job.' description: 'ID of the job.'
field :pipeline, Types::Ci::PipelineType, null: true, field :pipeline, Types::Ci::PipelineType, null: true,
description: 'Pipeline the job belongs to.' description: 'Pipeline the job belongs to.'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the job.' description: 'Name of the job.'
field :needs, BuildNeedType.connection_type, null: true, field :needs, BuildNeedType.connection_type, null: true,
description: 'References to builds that must complete before the jobs run.' description: 'References to builds that must complete before the jobs run.'
...@@ -24,11 +24,11 @@ module Types ...@@ -24,11 +24,11 @@ module Types
description: "Status of the job." description: "Status of the job."
field :stage, Types::Ci::StageType, null: true, field :stage, Types::Ci::StageType, null: true,
description: 'Stage of the job.' description: 'Stage of the job.'
field :allow_failure, ::GraphQL::BOOLEAN_TYPE, null: false, field :allow_failure, ::GraphQL::Types::Boolean, null: false,
description: 'Whether the job is allowed to fail.' description: 'Whether the job is allowed to fail.'
field :duration, GraphQL::INT_TYPE, null: true, field :duration, GraphQL::Types::Int, null: true,
description: 'Duration of the job in seconds.' description: 'Duration of the job in seconds.'
field :tags, [GraphQL::STRING_TYPE], null: true, field :tags, [GraphQL::Types::String], null: true,
description: 'Tags for the current job.' description: 'Tags for the current job.'
# Life-cycle timestamps: # Life-cycle timestamps:
...@@ -53,33 +53,33 @@ module Types ...@@ -53,33 +53,33 @@ module Types
description: 'Detailed status of the job.' description: 'Detailed status of the job.'
field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true, field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true,
description: 'Artifacts generated by the job.' description: 'Artifacts generated by the job.'
field :short_sha, type: GraphQL::STRING_TYPE, null: false, field :short_sha, type: GraphQL::Types::String, null: false,
description: 'Short SHA1 ID of the commit.' description: 'Short SHA1 ID of the commit.'
field :scheduling_type, GraphQL::STRING_TYPE, null: true, field :scheduling_type, GraphQL::Types::String, null: true,
description: 'Type of job scheduling. Value is `dag` if the job uses the `needs` keyword, and `stage` otherwise.' description: 'Type of job scheduling. Value is `dag` if the job uses the `needs` keyword, and `stage` otherwise.'
field :commit_path, GraphQL::STRING_TYPE, null: true, field :commit_path, GraphQL::Types::String, null: true,
description: 'Path to the commit that triggered the job.' description: 'Path to the commit that triggered the job.'
field :ref_name, GraphQL::STRING_TYPE, null: true, field :ref_name, GraphQL::Types::String, null: true,
description: 'Ref name of the job.' description: 'Ref name of the job.'
field :ref_path, GraphQL::STRING_TYPE, null: true, field :ref_path, GraphQL::Types::String, null: true,
description: 'Path to the ref.' description: 'Path to the ref.'
field :playable, GraphQL::BOOLEAN_TYPE, null: false, method: :playable?, field :playable, GraphQL::Types::Boolean, null: false, method: :playable?,
description: 'Indicates the job can be played.' description: 'Indicates the job can be played.'
field :retryable, GraphQL::BOOLEAN_TYPE, null: false, method: :retryable?, field :retryable, GraphQL::Types::Boolean, null: false, method: :retryable?,
description: 'Indicates the job can be retried.' description: 'Indicates the job can be retried.'
field :cancelable, GraphQL::BOOLEAN_TYPE, null: false, method: :cancelable?, field :cancelable, GraphQL::Types::Boolean, null: false, method: :cancelable?,
description: 'Indicates the job can be canceled.' description: 'Indicates the job can be canceled.'
field :active, GraphQL::BOOLEAN_TYPE, null: false, method: :active?, field :active, GraphQL::Types::Boolean, null: false, method: :active?,
description: 'Indicates the job is active.' description: 'Indicates the job is active.'
field :stuck, GraphQL::BOOLEAN_TYPE, null: false, method: :stuck?, field :stuck, GraphQL::Types::Boolean, null: false, method: :stuck?,
description: 'Indicates the job is stuck.' description: 'Indicates the job is stuck.'
field :coverage, GraphQL::FLOAT_TYPE, null: true, field :coverage, GraphQL::FLOAT_TYPE, null: true,
description: 'Coverage level of the job.' description: 'Coverage level of the job.'
field :created_by_tag, GraphQL::BOOLEAN_TYPE, null: false, field :created_by_tag, GraphQL::Types::Boolean, null: false,
description: 'Whether the job was created by a tag.' description: 'Whether the job was created by a tag.'
field :manual_job, GraphQL::BOOLEAN_TYPE, null: true, field :manual_job, GraphQL::Types::Boolean, null: true,
description: 'Whether the job has a manual action.' description: 'Whether the job has a manual action.'
field :triggered, GraphQL::BOOLEAN_TYPE, null: true, field :triggered, GraphQL::Types::Boolean, null: true,
description: 'Whether the job was triggered.' description: 'Whether the job was triggered.'
def pipeline def pipeline
......
...@@ -12,25 +12,25 @@ module Types ...@@ -12,25 +12,25 @@ module Types
expose_permissions Types::PermissionTypes::Ci::Pipeline expose_permissions Types::PermissionTypes::Ci::Pipeline
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the pipeline.' description: 'ID of the pipeline.'
field :iid, GraphQL::STRING_TYPE, null: false, field :iid, GraphQL::Types::String, null: false,
description: 'Internal ID of the pipeline.' description: 'Internal ID of the pipeline.'
field :sha, GraphQL::STRING_TYPE, null: false, field :sha, GraphQL::Types::String, null: false,
description: "SHA of the pipeline's commit." description: "SHA of the pipeline's commit."
field :before_sha, GraphQL::STRING_TYPE, null: true, field :before_sha, GraphQL::Types::String, null: true,
description: 'Base SHA of the source branch.' description: 'Base SHA of the source branch.'
field :complete, GraphQL::BOOLEAN_TYPE, null: false, method: :complete?, field :complete, GraphQL::Types::Boolean, null: false, method: :complete?,
description: 'Indicates if a pipeline is complete.' description: 'Indicates if a pipeline is complete.'
field :status, PipelineStatusEnum, null: false, field :status, PipelineStatusEnum, null: false,
description: "Status of the pipeline (#{::Ci::Pipeline.all_state_names.compact.join(', ').upcase})" description: "Status of the pipeline (#{::Ci::Pipeline.all_state_names.compact.join(', ').upcase})"
field :warnings, GraphQL::BOOLEAN_TYPE, null: false, method: :has_warnings?, field :warnings, GraphQL::Types::Boolean, null: false, method: :has_warnings?,
description: "Indicates if a pipeline has warnings." description: "Indicates if a pipeline has warnings."
field :detailed_status, Types::Ci::DetailedStatusType, null: false, field :detailed_status, Types::Ci::DetailedStatusType, null: false,
...@@ -39,7 +39,7 @@ module Types ...@@ -39,7 +39,7 @@ module Types
field :config_source, PipelineConfigSourceEnum, null: true, field :config_source, PipelineConfigSourceEnum, null: true,
description: "Configuration source of the pipeline (#{::Enums::Ci::Pipeline.config_sources.keys.join(', ').upcase})" description: "Configuration source of the pipeline (#{::Enums::Ci::Pipeline.config_sources.keys.join(', ').upcase})"
field :duration, GraphQL::INT_TYPE, null: true, field :duration, GraphQL::Types::Int, null: true,
description: 'Duration of the pipeline in seconds.' description: 'Duration of the pipeline in seconds.'
field :queued_duration, Types::DurationType, null: true, field :queued_duration, Types::DurationType, null: true,
...@@ -76,12 +76,12 @@ module Types ...@@ -76,12 +76,12 @@ module Types
null: true, null: true,
description: 'Pipeline user.' description: 'Pipeline user.'
field :retryable, GraphQL::BOOLEAN_TYPE, field :retryable, GraphQL::Types::Boolean,
description: 'Specifies if a pipeline can be retried.', description: 'Specifies if a pipeline can be retried.',
method: :retryable?, method: :retryable?,
null: false null: false
field :cancelable, GraphQL::BOOLEAN_TYPE, field :cancelable, GraphQL::Types::Boolean,
description: 'Specifies if a pipeline can be canceled.', description: 'Specifies if a pipeline can be canceled.',
method: :cancelable?, method: :cancelable?,
null: false null: false
...@@ -103,7 +103,7 @@ module Types ...@@ -103,7 +103,7 @@ module Types
required: false, required: false,
description: 'ID of the job.' description: 'ID of the job.'
argument :name, argument :name,
type: ::GraphQL::STRING_TYPE, type: ::GraphQL::Types::String,
required: false, required: false,
description: 'Name of the job.' description: 'Name of the job.'
end end
...@@ -122,19 +122,19 @@ module Types ...@@ -122,19 +122,19 @@ module Types
description: 'Pipeline that triggered the pipeline.', description: 'Pipeline that triggered the pipeline.',
method: :triggered_by_pipeline method: :triggered_by_pipeline
field :path, GraphQL::STRING_TYPE, null: true, field :path, GraphQL::Types::String, null: true,
description: "Relative path to the pipeline's page." description: "Relative path to the pipeline's page."
field :commit_path, GraphQL::STRING_TYPE, null: true, field :commit_path, GraphQL::Types::String, null: true,
description: 'Path to the commit that triggered the pipeline.' description: 'Path to the commit that triggered the pipeline.'
field :project, Types::ProjectType, null: true, field :project, Types::ProjectType, null: true,
description: 'Project the pipeline belongs to.' description: 'Project the pipeline belongs to.'
field :active, GraphQL::BOOLEAN_TYPE, null: false, method: :active?, field :active, GraphQL::Types::Boolean, null: false, method: :active?,
description: 'Indicates if the pipeline is active.' description: 'Indicates if the pipeline is active.'
field :uses_needs, GraphQL::BOOLEAN_TYPE, null: true, field :uses_needs, GraphQL::Types::Boolean, null: true,
method: :uses_needs?, method: :uses_needs?,
description: 'Indicates if the pipeline has jobs with `needs` dependencies.' description: 'Indicates if the pipeline has jobs with `needs` dependencies.'
...@@ -150,7 +150,7 @@ module Types ...@@ -150,7 +150,7 @@ module Types
description: 'A specific test suite in a pipeline test report.', description: 'A specific test suite in a pipeline test report.',
resolver: Resolvers::Ci::TestSuiteResolver resolver: Resolvers::Ci::TestSuiteResolver
field :ref, GraphQL::STRING_TYPE, null: true, field :ref, GraphQL::Types::String, null: true,
description: 'Reference to the branch from which the pipeline was triggered.' description: 'Reference to the branch from which the pipeline was triggered.'
def detailed_status def detailed_status
......
...@@ -9,10 +9,10 @@ module Types ...@@ -9,10 +9,10 @@ module Types
connection_type_class(Types::CountableConnectionType) connection_type_class(Types::CountableConnectionType)
field :count, GraphQL::INT_TYPE, null: true, field :count, GraphQL::Types::Int, null: true,
description: 'Number of times the test case has failed in the past 14 days.' description: 'Number of times the test case has failed in the past 14 days.'
field :base_branch, GraphQL::STRING_TYPE, null: true, field :base_branch, GraphQL::Types::String, null: true,
description: 'Name of the base branch of the project.' description: 'Name of the base branch of the project.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -6,9 +6,9 @@ module Types ...@@ -6,9 +6,9 @@ module Types
class RunnerArchitectureType < BaseObject class RunnerArchitectureType < BaseObject
graphql_name 'RunnerArchitecture' graphql_name 'RunnerArchitecture'
field :name, GraphQL::STRING_TYPE, null: false, field :name, GraphQL::Types::String, null: false,
description: 'Name of the runner platform architecture.' description: 'Name of the runner platform architecture.'
field :download_location, GraphQL::STRING_TYPE, null: false, field :download_location, GraphQL::Types::String, null: false,
description: 'Download location for the runner for the platform architecture.' description: 'Download location for the runner for the platform architecture.'
end end
end end
......
...@@ -6,9 +6,9 @@ module Types ...@@ -6,9 +6,9 @@ module Types
class RunnerPlatformType < BaseObject class RunnerPlatformType < BaseObject
graphql_name 'RunnerPlatform' graphql_name 'RunnerPlatform'
field :name, GraphQL::STRING_TYPE, null: false, field :name, GraphQL::Types::String, null: false,
description: 'Name slug of the runner platform.' description: 'Name slug of the runner platform.'
field :human_readable_name, GraphQL::STRING_TYPE, null: false, field :human_readable_name, GraphQL::Types::String, null: false,
description: 'Human readable name of the runner platform.' description: 'Human readable name of the runner platform.'
field :architectures, Types::Ci::RunnerArchitectureType.connection_type, null: true, field :architectures, Types::Ci::RunnerArchitectureType.connection_type, null: true,
description: 'Runner architectures supported for the platform.' description: 'Runner architectures supported for the platform.'
......
...@@ -6,9 +6,9 @@ module Types ...@@ -6,9 +6,9 @@ module Types
class RunnerSetupType < BaseObject class RunnerSetupType < BaseObject
graphql_name 'RunnerSetup' graphql_name 'RunnerSetup'
field :install_instructions, GraphQL::STRING_TYPE, null: false, field :install_instructions, GraphQL::Types::String, null: false,
description: 'Instructions for installing the runner on the specified architecture.' description: 'Instructions for installing the runner on the specified architecture.'
field :register_instructions, GraphQL::STRING_TYPE, null: true, field :register_instructions, GraphQL::Types::String, null: true,
description: 'Instructions for registering the runner.' description: 'Instructions for registering the runner.'
end end
end end
......
...@@ -12,38 +12,38 @@ module Types ...@@ -12,38 +12,38 @@ module Types
field :id, ::Types::GlobalIDType[::Ci::Runner], null: false, field :id, ::Types::GlobalIDType[::Ci::Runner], null: false,
description: 'ID of the runner.' description: 'ID of the runner.'
field :description, GraphQL::STRING_TYPE, null: true, field :description, GraphQL::Types::String, null: true,
description: 'Description of the runner.' description: 'Description of the runner.'
field :contacted_at, Types::TimeType, null: true, field :contacted_at, Types::TimeType, null: true,
description: 'Last contact from the runner.', description: 'Last contact from the runner.',
method: :contacted_at method: :contacted_at
field :maximum_timeout, GraphQL::INT_TYPE, null: true, field :maximum_timeout, GraphQL::Types::Int, null: true,
description: 'Maximum timeout (in seconds) for jobs processed by the runner.' description: 'Maximum timeout (in seconds) for jobs processed by the runner.'
field :access_level, ::Types::Ci::RunnerAccessLevelEnum, null: false, field :access_level, ::Types::Ci::RunnerAccessLevelEnum, null: false,
description: 'Access level of the runner.' description: 'Access level of the runner.'
field :active, GraphQL::BOOLEAN_TYPE, null: false, field :active, GraphQL::Types::Boolean, null: false,
description: 'Indicates the runner is allowed to receive jobs.' description: 'Indicates the runner is allowed to receive jobs.'
field :status, ::Types::Ci::RunnerStatusEnum, null: false, field :status, ::Types::Ci::RunnerStatusEnum, null: false,
description: 'Status of the runner.' description: 'Status of the runner.'
field :version, GraphQL::STRING_TYPE, null: true, field :version, GraphQL::Types::String, null: true,
description: 'Version of the runner.' description: 'Version of the runner.'
field :short_sha, GraphQL::STRING_TYPE, null: true, field :short_sha, GraphQL::Types::String, null: true,
description: %q(First eight characters of the runner's token used to authenticate new job requests. Used as the runner's unique ID.) description: %q(First eight characters of the runner's token used to authenticate new job requests. Used as the runner's unique ID.)
field :revision, GraphQL::STRING_TYPE, null: true, field :revision, GraphQL::Types::String, null: true,
description: 'Revision of the runner.' description: 'Revision of the runner.'
field :locked, GraphQL::BOOLEAN_TYPE, null: true, field :locked, GraphQL::Types::Boolean, null: true,
description: 'Indicates the runner is locked.' description: 'Indicates the runner is locked.'
field :run_untagged, GraphQL::BOOLEAN_TYPE, null: false, field :run_untagged, GraphQL::Types::Boolean, null: false,
description: 'Indicates the runner is able to run untagged jobs.' description: 'Indicates the runner is able to run untagged jobs.'
field :ip_address, GraphQL::STRING_TYPE, null: true, field :ip_address, GraphQL::Types::String, null: true,
description: 'IP address of the runner.' description: 'IP address of the runner.'
field :runner_type, ::Types::Ci::RunnerTypeEnum, null: false, field :runner_type, ::Types::Ci::RunnerTypeEnum, null: false,
description: 'Type of the runner.' description: 'Type of the runner.'
field :tag_list, [GraphQL::STRING_TYPE], null: true, field :tag_list, [GraphQL::Types::String], null: true,
description: 'Tags associated with the runner.' description: 'Tags associated with the runner.'
field :project_count, GraphQL::INT_TYPE, null: true, field :project_count, GraphQL::Types::Int, null: true,
description: 'Number of projects that the runner is associated with.' description: 'Number of projects that the runner is associated with.'
field :job_count, GraphQL::INT_TYPE, null: true, field :job_count, GraphQL::Types::Int, null: true,
description: "Number of jobs processed by the runner (limited to #{JOB_COUNT_LIMIT}, plus one to indicate that more items exist)." description: "Number of jobs processed by the runner (limited to #{JOB_COUNT_LIMIT}, plus one to indicate that more items exist)."
def job_count def job_count
......
...@@ -6,9 +6,9 @@ module Types ...@@ -6,9 +6,9 @@ module Types
graphql_name 'CiStage' graphql_name 'CiStage'
authorize :read_commit_status authorize :read_commit_status
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the stage.' description: 'ID of the stage.'
field :name, type: GraphQL::STRING_TYPE, null: true, field :name, type: GraphQL::Types::String, null: true,
description: 'Name of the stage.' description: 'Name of the stage.'
field :groups, type: Ci::GroupType.connection_type, null: true, field :groups, type: Ci::GroupType.connection_type, null: true,
extras: [:lookahead], extras: [:lookahead],
...@@ -18,7 +18,7 @@ module Types ...@@ -18,7 +18,7 @@ module Types
field :jobs, Ci::JobType.connection_type, null: true, field :jobs, Ci::JobType.connection_type, null: true,
description: 'Jobs for the stage.', description: 'Jobs for the stage.',
method: 'latest_statuses' method: 'latest_statuses'
field :status, GraphQL::STRING_TYPE, field :status, GraphQL::Types::String,
null: true, null: true,
description: 'Status of the pipeline stage.' description: 'Status of the pipeline stage.'
......
...@@ -5,19 +5,19 @@ module Types ...@@ -5,19 +5,19 @@ module Types
class StatusActionType < BaseObject class StatusActionType < BaseObject
graphql_name 'StatusAction' graphql_name 'StatusAction'
field :id, GraphQL::STRING_TYPE, null: false, field :id, GraphQL::Types::String, null: false,
description: 'ID for a status action.', description: 'ID for a status action.',
extras: [:parent] extras: [:parent]
field :button_title, GraphQL::STRING_TYPE, null: true, field :button_title, GraphQL::Types::String, null: true,
description: 'Title for the button, for example: Retry this job.' description: 'Title for the button, for example: Retry this job.'
field :icon, GraphQL::STRING_TYPE, null: true, field :icon, GraphQL::Types::String, null: true,
description: 'Icon used in the action button.' description: 'Icon used in the action button.'
field :method, GraphQL::STRING_TYPE, null: true, field :method, GraphQL::Types::String, null: true,
description: 'Method for the action, for example: :post.', description: 'Method for the action, for example: :post.',
resolver_method: :action_method resolver_method: :action_method
field :path, GraphQL::STRING_TYPE, null: true, field :path, GraphQL::Types::String, null: true,
description: 'Path for the action.' description: 'Path for the action.'
field :title, GraphQL::STRING_TYPE, null: true, field :title, GraphQL::Types::String, null: true,
description: 'Title for the action, for example: Retry.' description: 'Title for the action, for example: Retry.'
def id(parent:) def id(parent:)
......
...@@ -7,9 +7,9 @@ module Types ...@@ -7,9 +7,9 @@ module Types
graphql_name 'CiTemplate' graphql_name 'CiTemplate'
description 'GitLab CI/CD configuration template.' description 'GitLab CI/CD configuration template.'
field :name, GraphQL::STRING_TYPE, null: false, field :name, GraphQL::Types::String, null: false,
description: 'Name of the CI template.' description: 'Name of the CI template.'
field :content, GraphQL::STRING_TYPE, null: false, field :content, GraphQL::Types::String, null: false,
description: 'Contents of the CI template.' description: 'Contents of the CI template.'
end end
end end
......
...@@ -12,25 +12,25 @@ module Types ...@@ -12,25 +12,25 @@ module Types
field :status, Types::Ci::TestCaseStatusEnum, null: true, field :status, Types::Ci::TestCaseStatusEnum, null: true,
description: "Status of the test case (#{::Gitlab::Ci::Reports::TestCase::STATUS_TYPES.join(', ')})." description: "Status of the test case (#{::Gitlab::Ci::Reports::TestCase::STATUS_TYPES.join(', ')})."
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the test case.' description: 'Name of the test case.'
field :classname, GraphQL::STRING_TYPE, null: true, field :classname, GraphQL::Types::String, null: true,
description: 'Classname of the test case.' description: 'Classname of the test case.'
field :execution_time, GraphQL::FLOAT_TYPE, null: true, field :execution_time, GraphQL::FLOAT_TYPE, null: true,
description: 'Test case execution time in seconds.' description: 'Test case execution time in seconds.'
field :file, GraphQL::STRING_TYPE, null: true, field :file, GraphQL::Types::String, null: true,
description: 'Path to the file of the test case.' description: 'Path to the file of the test case.'
field :attachment_url, GraphQL::STRING_TYPE, null: true, field :attachment_url, GraphQL::Types::String, null: true,
description: 'URL of the test case attachment file.' description: 'URL of the test case attachment file.'
field :system_output, GraphQL::STRING_TYPE, null: true, field :system_output, GraphQL::Types::String, null: true,
description: 'System output of the test case.' description: 'System output of the test case.'
field :stack_trace, GraphQL::STRING_TYPE, null: true, field :stack_trace, GraphQL::Types::String, null: true,
description: 'Stack trace of the test case.' description: 'Stack trace of the test case.'
field :recent_failures, Types::Ci::RecentFailuresType, null: true, field :recent_failures, Types::Ci::RecentFailuresType, null: true,
......
...@@ -10,22 +10,22 @@ module Types ...@@ -10,22 +10,22 @@ module Types
field :time, GraphQL::FLOAT_TYPE, null: true, field :time, GraphQL::FLOAT_TYPE, null: true,
description: 'Total duration of the tests.' description: 'Total duration of the tests.'
field :count, GraphQL::INT_TYPE, null: true, field :count, GraphQL::Types::Int, null: true,
description: 'Total number of the test cases.' description: 'Total number of the test cases.'
field :success, GraphQL::INT_TYPE, null: true, field :success, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that succeeded.' description: 'Total number of test cases that succeeded.'
field :failed, GraphQL::INT_TYPE, null: true, field :failed, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that failed.' description: 'Total number of test cases that failed.'
field :skipped, GraphQL::INT_TYPE, null: true, field :skipped, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that were skipped.' description: 'Total number of test cases that were skipped.'
field :error, GraphQL::INT_TYPE, null: true, field :error, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that had an error.' description: 'Total number of test cases that had an error.'
field :suite_error, GraphQL::STRING_TYPE, null: true, field :suite_error, GraphQL::Types::String, null: true,
description: 'Test suite error message.' description: 'Test suite error message.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -9,31 +9,31 @@ module Types ...@@ -9,31 +9,31 @@ module Types
connection_type_class(Types::CountableConnectionType) connection_type_class(Types::CountableConnectionType)
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the test suite.' description: 'Name of the test suite.'
field :total_time, GraphQL::FLOAT_TYPE, null: true, field :total_time, GraphQL::FLOAT_TYPE, null: true,
description: 'Total duration of the tests in the test suite.' description: 'Total duration of the tests in the test suite.'
field :total_count, GraphQL::INT_TYPE, null: true, field :total_count, GraphQL::Types::Int, null: true,
description: 'Total number of the test cases in the test suite.' description: 'Total number of the test cases in the test suite.'
field :success_count, GraphQL::INT_TYPE, null: true, field :success_count, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that succeeded in the test suite.' description: 'Total number of test cases that succeeded in the test suite.'
field :failed_count, GraphQL::INT_TYPE, null: true, field :failed_count, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that failed in the test suite.' description: 'Total number of test cases that failed in the test suite.'
field :skipped_count, GraphQL::INT_TYPE, null: true, field :skipped_count, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that were skipped in the test suite.' description: 'Total number of test cases that were skipped in the test suite.'
field :error_count, GraphQL::INT_TYPE, null: true, field :error_count, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that had an error.' description: 'Total number of test cases that had an error.'
field :suite_error, GraphQL::STRING_TYPE, null: true, field :suite_error, GraphQL::Types::String, null: true,
description: 'Test suite error message.' description: 'Test suite error message.'
field :build_ids, [GraphQL::ID_TYPE], null: true, field :build_ids, [GraphQL::Types::ID], null: true,
description: 'IDs of the builds used to run the test suite.' description: 'IDs of the builds used to run the test suite.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -9,28 +9,28 @@ module Types ...@@ -9,28 +9,28 @@ module Types
connection_type_class(Types::CountableConnectionType) connection_type_class(Types::CountableConnectionType)
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the test suite.' description: 'Name of the test suite.'
field :total_time, GraphQL::FLOAT_TYPE, null: true, field :total_time, GraphQL::FLOAT_TYPE, null: true,
description: 'Total duration of the tests in the test suite.' description: 'Total duration of the tests in the test suite.'
field :total_count, GraphQL::INT_TYPE, null: true, field :total_count, GraphQL::Types::Int, null: true,
description: 'Total number of the test cases in the test suite.' description: 'Total number of the test cases in the test suite.'
field :success_count, GraphQL::INT_TYPE, null: true, field :success_count, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that succeeded in the test suite.' description: 'Total number of test cases that succeeded in the test suite.'
field :failed_count, GraphQL::INT_TYPE, null: true, field :failed_count, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that failed in the test suite.' description: 'Total number of test cases that failed in the test suite.'
field :skipped_count, GraphQL::INT_TYPE, null: true, field :skipped_count, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that were skipped in the test suite.' description: 'Total number of test cases that were skipped in the test suite.'
field :error_count, GraphQL::INT_TYPE, null: true, field :error_count, GraphQL::Types::Int, null: true,
description: 'Total number of test cases that had an error.' description: 'Total number of test cases that had an error.'
field :suite_error, GraphQL::STRING_TYPE, null: true, field :suite_error, GraphQL::Types::String, null: true,
description: 'Test suite error message.' description: 'Test suite error message.'
field :test_cases, Types::Ci::TestCaseType.connection_type, null: true, field :test_cases, Types::Ci::TestCaseType.connection_type, null: true,
......
...@@ -7,10 +7,10 @@ module Types ...@@ -7,10 +7,10 @@ module Types
graphql_name 'SastCiConfigurationAnalyzersEntityInput' graphql_name 'SastCiConfigurationAnalyzersEntityInput'
description 'Represents the analyzers entity in SAST CI configuration' description 'Represents the analyzers entity in SAST CI configuration'
argument :name, GraphQL::STRING_TYPE, required: true, argument :name, GraphQL::Types::String, required: true,
description: 'Name of analyzer.' description: 'Name of analyzer.'
argument :enabled, GraphQL::BOOLEAN_TYPE, required: true, argument :enabled, GraphQL::Types::Boolean, required: true,
description: 'State of the analyzer.' description: 'State of the analyzer.'
argument :variables, [::Types::CiConfiguration::Sast::EntityInputType], argument :variables, [::Types::CiConfiguration::Sast::EntityInputType],
......
...@@ -8,16 +8,16 @@ module Types ...@@ -8,16 +8,16 @@ module Types
graphql_name 'SastCiConfigurationAnalyzersEntity' graphql_name 'SastCiConfigurationAnalyzersEntity'
description 'Represents an analyzer entity in SAST CI configuration' description 'Represents an analyzer entity in SAST CI configuration'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the analyzer.' description: 'Name of the analyzer.'
field :label, GraphQL::STRING_TYPE, null: true, field :label, GraphQL::Types::String, null: true,
description: 'Analyzer label used in the config UI.' description: 'Analyzer label used in the config UI.'
field :enabled, GraphQL::BOOLEAN_TYPE, null: true, field :enabled, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether an analyzer is enabled.' description: 'Indicates whether an analyzer is enabled.'
field :description, GraphQL::STRING_TYPE, null: true, field :description, GraphQL::Types::String, null: true,
description: 'Analyzer description that is displayed on the form.' description: 'Analyzer description that is displayed on the form.'
field :variables, ::Types::CiConfiguration::Sast::EntityType.connection_type, null: true, field :variables, ::Types::CiConfiguration::Sast::EntityType.connection_type, null: true,
......
...@@ -7,13 +7,13 @@ module Types ...@@ -7,13 +7,13 @@ module Types
graphql_name 'SastCiConfigurationEntityInput' graphql_name 'SastCiConfigurationEntityInput'
description 'Represents an entity in SAST CI configuration' description 'Represents an entity in SAST CI configuration'
argument :field, GraphQL::STRING_TYPE, required: true, argument :field, GraphQL::Types::String, required: true,
description: 'CI keyword of entity.' description: 'CI keyword of entity.'
argument :default_value, GraphQL::STRING_TYPE, required: true, argument :default_value, GraphQL::Types::String, required: true,
description: 'Default value that is used if value is empty.' description: 'Default value that is used if value is empty.'
argument :value, GraphQL::STRING_TYPE, required: true, argument :value, GraphQL::Types::String, required: true,
description: 'Current value of the entity.' description: 'Current value of the entity.'
end end
end end
......
...@@ -8,25 +8,25 @@ module Types ...@@ -8,25 +8,25 @@ module Types
graphql_name 'SastCiConfigurationEntity' graphql_name 'SastCiConfigurationEntity'
description 'Represents an entity in SAST CI configuration' description 'Represents an entity in SAST CI configuration'
field :field, GraphQL::STRING_TYPE, null: true, field :field, GraphQL::Types::String, null: true,
description: 'CI keyword of entity.' description: 'CI keyword of entity.'
field :label, GraphQL::STRING_TYPE, null: true, field :label, GraphQL::Types::String, null: true,
description: 'Label for entity used in the form.' description: 'Label for entity used in the form.'
field :type, GraphQL::STRING_TYPE, null: true, field :type, GraphQL::Types::String, null: true,
description: 'Type of the field value.' description: 'Type of the field value.'
field :options, ::Types::CiConfiguration::Sast::OptionsEntityType.connection_type, null: true, field :options, ::Types::CiConfiguration::Sast::OptionsEntityType.connection_type, null: true,
description: 'Different possible values of the field.' description: 'Different possible values of the field.'
field :default_value, GraphQL::STRING_TYPE, null: true, field :default_value, GraphQL::Types::String, null: true,
description: 'Default value that is used if value is empty.' description: 'Default value that is used if value is empty.'
field :description, GraphQL::STRING_TYPE, null: true, field :description, GraphQL::Types::String, null: true,
description: 'Entity description that is displayed on the form.' description: 'Entity description that is displayed on the form.'
field :value, GraphQL::STRING_TYPE, null: true, field :value, GraphQL::Types::String, null: true,
description: 'Current value of the entity.' description: 'Current value of the entity.'
field :size, ::Types::CiConfiguration::Sast::UiComponentSizeEnum, null: true, field :size, ::Types::CiConfiguration::Sast::UiComponentSizeEnum, null: true,
......
...@@ -8,10 +8,10 @@ module Types ...@@ -8,10 +8,10 @@ module Types
graphql_name 'SastCiConfigurationOptionsEntity' graphql_name 'SastCiConfigurationOptionsEntity'
description 'Represents an entity for options in SAST CI configuration' description 'Represents an entity for options in SAST CI configuration'
field :label, GraphQL::STRING_TYPE, null: true, field :label, GraphQL::Types::String, null: true,
description: 'Label of option entity.' description: 'Label of option entity.'
field :value, GraphQL::STRING_TYPE, null: true, field :value, GraphQL::Types::String, null: true,
description: 'Value of option entity.' description: 'Value of option entity.'
end end
end end
......
...@@ -4,15 +4,15 @@ module Types ...@@ -4,15 +4,15 @@ module Types
class CommitActionType < BaseInputObject class CommitActionType < BaseInputObject
argument :action, type: Types::CommitActionModeEnum, required: true, argument :action, type: Types::CommitActionModeEnum, required: true,
description: 'The action to perform, create, delete, move, update, chmod.' description: 'The action to perform, create, delete, move, update, chmod.'
argument :file_path, type: GraphQL::STRING_TYPE, required: true, argument :file_path, type: GraphQL::Types::String, required: true,
description: 'Full path to the file.' description: 'Full path to the file.'
argument :content, type: GraphQL::STRING_TYPE, required: false, argument :content, type: GraphQL::Types::String, required: false,
description: 'Content of the file.' description: 'Content of the file.'
argument :previous_path, type: GraphQL::STRING_TYPE, required: false, argument :previous_path, type: GraphQL::Types::String, required: false,
description: 'Original full path to the file being moved.' description: 'Original full path to the file being moved.'
argument :last_commit_id, type: GraphQL::STRING_TYPE, required: false, argument :last_commit_id, type: GraphQL::Types::String, required: false,
description: 'Last known file commit ID.' description: 'Last known file commit ID.'
argument :execute_filemode, type: GraphQL::BOOLEAN_TYPE, required: false, argument :execute_filemode, type: GraphQL::Types::Boolean, required: false,
description: 'Enables/disables the execute flag on the file.' description: 'Enables/disables the execute flag on the file.'
argument :encoding, type: Types::CommitEncodingEnum, required: false, argument :encoding, type: Types::CommitEncodingEnum, required: false,
description: 'Encoding of the file. Default is text.' description: 'Encoding of the file. Default is text.'
......
...@@ -8,31 +8,31 @@ module Types ...@@ -8,31 +8,31 @@ module Types
present_using CommitPresenter present_using CommitPresenter
field :id, type: GraphQL::ID_TYPE, null: false, field :id, type: GraphQL::Types::ID, null: false,
description: 'ID (global ID) of the commit.' description: 'ID (global ID) of the commit.'
field :sha, type: GraphQL::STRING_TYPE, null: false, field :sha, type: GraphQL::Types::String, null: false,
description: 'SHA1 ID of the commit.' description: 'SHA1 ID of the commit.'
field :short_id, type: GraphQL::STRING_TYPE, null: false, field :short_id, type: GraphQL::Types::String, null: false,
description: 'Short SHA1 ID of the commit.' description: 'Short SHA1 ID of the commit.'
field :title, type: GraphQL::STRING_TYPE, null: true, calls_gitaly: true, field :title, type: GraphQL::Types::String, null: true, calls_gitaly: true,
description: 'Title of the commit message.' description: 'Title of the commit message.'
markdown_field :title_html, null: true markdown_field :title_html, null: true
field :description, type: GraphQL::STRING_TYPE, null: true, field :description, type: GraphQL::Types::String, null: true,
description: 'Description of the commit message.' description: 'Description of the commit message.'
markdown_field :description_html, null: true markdown_field :description_html, null: true
field :message, type: GraphQL::STRING_TYPE, null: true, field :message, type: GraphQL::Types::String, null: true,
description: 'Raw commit message.' description: 'Raw commit message.'
field :authored_date, type: Types::TimeType, null: true, field :authored_date, type: Types::TimeType, null: true,
description: 'Timestamp of when the commit was authored.' description: 'Timestamp of when the commit was authored.'
field :web_url, type: GraphQL::STRING_TYPE, null: false, field :web_url, type: GraphQL::Types::String, null: false,
description: 'Web URL of the commit.' description: 'Web URL of the commit.'
field :web_path, type: GraphQL::STRING_TYPE, null: false, field :web_path, type: GraphQL::Types::String, null: false,
description: 'Web path of the commit.' description: 'Web path of the commit.'
field :signature_html, type: GraphQL::STRING_TYPE, null: true, calls_gitaly: true, field :signature_html, type: GraphQL::Types::String, null: true, calls_gitaly: true,
description: 'Rendered HTML of the commit signature.' description: 'Rendered HTML of the commit signature.'
field :author_name, type: GraphQL::STRING_TYPE, null: true, field :author_name, type: GraphQL::Types::String, null: true,
description: 'Commit authors name.' description: 'Commit authors name.'
field :author_gravatar, type: GraphQL::STRING_TYPE, null: true, field :author_gravatar, type: GraphQL::Types::String, null: true,
description: 'Commit authors gravatar.' description: 'Commit authors gravatar.'
# models/commit lazy loads the author by email # models/commit lazy loads the author by email
......
...@@ -10,7 +10,7 @@ module Types ...@@ -10,7 +10,7 @@ module Types
field :created_at, Types::TimeType, null: false, description: 'Timestamp of when the container expiration policy was created.' field :created_at, Types::TimeType, null: false, description: 'Timestamp of when the container expiration policy was created.'
field :updated_at, Types::TimeType, null: false, description: 'Timestamp of when the container expiration policy was updated.' field :updated_at, Types::TimeType, null: false, description: 'Timestamp of when the container expiration policy was updated.'
field :enabled, GraphQL::BOOLEAN_TYPE, null: false, description: 'Indicates whether this container expiration policy is enabled.' field :enabled, GraphQL::Types::Boolean, null: false, description: 'Indicates whether this container expiration policy is enabled.'
field :older_than, Types::ContainerExpirationPolicyOlderThanEnum, null: true, description: 'Tags older that this will expire.' field :older_than, Types::ContainerExpirationPolicyOlderThanEnum, null: true, description: 'Tags older that this will expire.'
field :cadence, Types::ContainerExpirationPolicyCadenceEnum, null: false, description: 'This container expiration policy schedule.' field :cadence, Types::ContainerExpirationPolicyCadenceEnum, null: false, description: 'This container expiration policy schedule.'
field :keep_n, Types::ContainerExpirationPolicyKeepEnum, null: true, description: 'Number of tags to retain.' field :keep_n, Types::ContainerExpirationPolicyKeepEnum, null: true, description: 'Number of tags to retain.'
......
...@@ -8,15 +8,15 @@ module Types ...@@ -8,15 +8,15 @@ module Types
authorize :read_container_image authorize :read_container_image
field :name, GraphQL::STRING_TYPE, null: false, description: 'Name of the tag.' field :name, GraphQL::Types::String, null: false, description: 'Name of the tag.'
field :path, GraphQL::STRING_TYPE, null: false, description: 'Path of the tag.' field :path, GraphQL::Types::String, null: false, description: 'Path of the tag.'
field :location, GraphQL::STRING_TYPE, null: false, description: 'URL of the tag.' field :location, GraphQL::Types::String, null: false, description: 'URL of the tag.'
field :digest, GraphQL::STRING_TYPE, null: true, description: 'Digest of the tag.' field :digest, GraphQL::Types::String, null: true, description: 'Digest of the tag.'
field :revision, GraphQL::STRING_TYPE, null: true, description: 'Revision of the tag.' field :revision, GraphQL::Types::String, null: true, description: 'Revision of the tag.'
field :short_revision, GraphQL::STRING_TYPE, null: true, description: 'Short revision of the tag.' field :short_revision, GraphQL::Types::String, null: true, description: 'Short revision of the tag.'
field :total_size, GraphQL::Types::BigInt, null: true, description: 'The size of the tag.' field :total_size, GraphQL::Types::BigInt, null: true, description: 'The size of the tag.'
field :created_at, Types::TimeType, null: true, description: 'Timestamp when the tag was created.' field :created_at, Types::TimeType, null: true, description: 'Timestamp when the tag was created.'
field :can_delete, GraphQL::BOOLEAN_TYPE, null: false, description: 'Can the current user delete this tag.' field :can_delete, GraphQL::Types::Boolean, null: false, description: 'Can the current user delete this tag.'
def can_delete def can_delete
Ability.allowed?(current_user, :destroy_container_image, object) Ability.allowed?(current_user, :destroy_container_image, object)
......
...@@ -8,17 +8,17 @@ module Types ...@@ -8,17 +8,17 @@ module Types
authorize :read_container_image authorize :read_container_image
field :id, GraphQL::ID_TYPE, null: false, description: 'ID of the container repository.' field :id, GraphQL::Types::ID, null: false, description: 'ID of the container repository.'
field :name, GraphQL::STRING_TYPE, null: false, description: 'Name of the container repository.' field :name, GraphQL::Types::String, null: false, description: 'Name of the container repository.'
field :path, GraphQL::STRING_TYPE, null: false, description: 'Path of the container repository.' field :path, GraphQL::Types::String, null: false, description: 'Path of the container repository.'
field :location, GraphQL::STRING_TYPE, null: false, description: 'URL of the container repository.' field :location, GraphQL::Types::String, null: false, description: 'URL of the container repository.'
field :created_at, Types::TimeType, null: false, description: 'Timestamp when the container repository was created.' field :created_at, Types::TimeType, null: false, description: 'Timestamp when the container repository was created.'
field :updated_at, Types::TimeType, null: false, description: 'Timestamp when the container repository was updated.' field :updated_at, Types::TimeType, null: false, description: 'Timestamp when the container repository was updated.'
field :expiration_policy_started_at, Types::TimeType, null: true, description: 'Timestamp when the cleanup done by the expiration policy was started on the container repository.' field :expiration_policy_started_at, Types::TimeType, null: true, description: 'Timestamp when the cleanup done by the expiration policy was started on the container repository.'
field :expiration_policy_cleanup_status, Types::ContainerRepositoryCleanupStatusEnum, null: true, description: 'The tags cleanup status for the container repository.' field :expiration_policy_cleanup_status, Types::ContainerRepositoryCleanupStatusEnum, null: true, description: 'The tags cleanup status for the container repository.'
field :status, Types::ContainerRepositoryStatusEnum, null: true, description: 'Status of the container repository.' field :status, Types::ContainerRepositoryStatusEnum, null: true, description: 'Status of the container repository.'
field :tags_count, GraphQL::INT_TYPE, null: false, description: 'Number of tags associated with this image.' field :tags_count, GraphQL::Types::Int, null: false, description: 'Number of tags associated with this image.'
field :can_delete, GraphQL::BOOLEAN_TYPE, null: false, description: 'Can the current user delete the container repository.' field :can_delete, GraphQL::Types::Boolean, null: false, description: 'Can the current user delete the container repository.'
field :project, Types::ProjectType, null: false, description: 'Project of the container registry.' field :project, Types::ProjectType, null: false, description: 'Project of the container registry.'
def can_delete def can_delete
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Types module Types
# rubocop: disable Graphql/AuthorizeTypes # rubocop: disable Graphql/AuthorizeTypes
class CountableConnectionType < GraphQL::Types::Relay::BaseConnection class CountableConnectionType < GraphQL::Types::Relay::BaseConnection
field :count, GraphQL::INT_TYPE, null: false, field :count, GraphQL::Types::Int, null: false,
description: 'Total count of collection.' description: 'Total count of collection.'
def count def count
......
...@@ -11,16 +11,16 @@ module Types ...@@ -11,16 +11,16 @@ module Types
null: false, null: false,
description: 'The ID of the emoji.' description: 'The ID of the emoji.'
field :name, GraphQL::STRING_TYPE, field :name, GraphQL::Types::String,
null: false, null: false,
description: 'The name of the emoji.' description: 'The name of the emoji.'
field :url, GraphQL::STRING_TYPE, field :url, GraphQL::Types::String,
null: false, null: false,
method: :file, method: :file,
description: 'The link to file of the emoji.' description: 'The link to file of the emoji.'
field :external, GraphQL::BOOLEAN_TYPE, field :external, GraphQL::Types::Boolean,
null: false, null: false,
description: 'Whether the emoji is an external link.' description: 'Whether the emoji is an external link.'
end end
......
...@@ -17,7 +17,7 @@ RSpec.describe Types::BaseField do ...@@ -17,7 +17,7 @@ RSpec.describe Types::BaseField do
end end
it 'defaults to 1' do it 'defaults to 1' do
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, null: true) field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true)
expect(field.to_graphql.complexity).to eq 1 expect(field.to_graphql.complexity).to eq 1
end end
...@@ -25,7 +25,7 @@ RSpec.describe Types::BaseField do ...@@ -25,7 +25,7 @@ RSpec.describe Types::BaseField do
describe '#base_complexity' do describe '#base_complexity' do
context 'with no gitaly calls' do context 'with no gitaly calls' do
it 'defaults to 1' do it 'defaults to 1' do
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, null: true) field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true)
expect(field.base_complexity).to eq 1 expect(field.base_complexity).to eq 1
end end
...@@ -33,7 +33,7 @@ RSpec.describe Types::BaseField do ...@@ -33,7 +33,7 @@ RSpec.describe Types::BaseField do
context 'with a gitaly call' do context 'with a gitaly call' do
it 'adds 1 to the default value' do it 'adds 1 to the default value' do
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, null: true, calls_gitaly: true) field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true, calls_gitaly: true)
expect(field.base_complexity).to eq 2 expect(field.base_complexity).to eq 2
end end
...@@ -41,14 +41,14 @@ RSpec.describe Types::BaseField do ...@@ -41,14 +41,14 @@ RSpec.describe Types::BaseField do
end end
it 'has specified value' do it 'has specified value' do
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, null: true, complexity: 12) field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true, complexity: 12)
expect(field.to_graphql.complexity).to eq 12 expect(field.to_graphql.complexity).to eq 12
end end
context 'when field has a resolver' do context 'when field has a resolver' do
context 'when a valid complexity is already set' do context 'when a valid complexity is already set' do
let(:field) { described_class.new(name: 'test', type: GraphQL::STRING_TYPE.connection_type, resolver_class: resolver, complexity: 2, max_page_size: 100, null: true) } let(:field) { described_class.new(name: 'test', type: GraphQL::Types::String.connection_type, resolver_class: resolver, complexity: 2, max_page_size: 100, null: true) }
it 'uses this complexity' do it 'uses this complexity' do
expect(field.to_graphql.complexity).to eq 2 expect(field.to_graphql.complexity).to eq 2
...@@ -56,7 +56,7 @@ RSpec.describe Types::BaseField do ...@@ -56,7 +56,7 @@ RSpec.describe Types::BaseField do
end end
context 'and is a connection' do context 'and is a connection' do
let(:field) { described_class.new(name: 'test', type: GraphQL::STRING_TYPE.connection_type, resolver_class: resolver, max_page_size: 100, null: true) } let(:field) { described_class.new(name: 'test', type: GraphQL::Types::String.connection_type, resolver_class: resolver, max_page_size: 100, null: true) }
it 'sets complexity depending on arguments for resolvers' do it 'sets complexity depending on arguments for resolvers' do
expect(field.to_graphql.complexity.call({}, {}, 2)).to eq 4 expect(field.to_graphql.complexity.call({}, {}, 2)).to eq 4
...@@ -71,7 +71,7 @@ RSpec.describe Types::BaseField do ...@@ -71,7 +71,7 @@ RSpec.describe Types::BaseField do
context 'and is not a connection' do context 'and is not a connection' do
it 'sets complexity as normal' do it 'sets complexity as normal' do
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: resolver, max_page_size: 100, null: true) field = described_class.new(name: 'test', type: GraphQL::Types::String, resolver_class: resolver, max_page_size: 100, null: true)
expect(field.to_graphql.complexity.call({}, {}, 2)).to eq 2 expect(field.to_graphql.complexity.call({}, {}, 2)).to eq 2
expect(field.to_graphql.complexity.call({}, { first: 50 }, 2)).to eq 2 expect(field.to_graphql.complexity.call({}, { first: 50 }, 2)).to eq 2
...@@ -82,8 +82,8 @@ RSpec.describe Types::BaseField do ...@@ -82,8 +82,8 @@ RSpec.describe Types::BaseField do
context 'calls_gitaly' do context 'calls_gitaly' do
context 'for fields with a resolver' do context 'for fields with a resolver' do
it 'adds 1 if true' do it 'adds 1 if true' do
with_gitaly_field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: resolver, null: true, calls_gitaly: true) with_gitaly_field = described_class.new(name: 'test', type: GraphQL::Types::String, resolver_class: resolver, null: true, calls_gitaly: true)
without_gitaly_field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: resolver, null: true) without_gitaly_field = described_class.new(name: 'test', type: GraphQL::Types::String, resolver_class: resolver, null: true)
base_result = without_gitaly_field.to_graphql.complexity.call({}, {}, 2) base_result = without_gitaly_field.to_graphql.complexity.call({}, {}, 2)
expect(with_gitaly_field.to_graphql.complexity.call({}, {}, 2)).to eq base_result + 1 expect(with_gitaly_field.to_graphql.complexity.call({}, {}, 2)).to eq base_result + 1
...@@ -92,28 +92,28 @@ RSpec.describe Types::BaseField do ...@@ -92,28 +92,28 @@ RSpec.describe Types::BaseField do
context 'for fields without a resolver' do context 'for fields without a resolver' do
it 'adds 1 if true' do it 'adds 1 if true' do
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, null: true, calls_gitaly: true) field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true, calls_gitaly: true)
expect(field.to_graphql.complexity).to eq 2 expect(field.to_graphql.complexity).to eq 2
end end
end end
it 'defaults to false' do it 'defaults to false' do
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, null: true) field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true)
expect(field.base_complexity).to eq Types::BaseField::DEFAULT_COMPLEXITY expect(field.base_complexity).to eq Types::BaseField::DEFAULT_COMPLEXITY
end end
context 'with declared constant complexity value' do context 'with declared constant complexity value' do
it 'has complexity set to that constant' do it 'has complexity set to that constant' do
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, null: true, complexity: 12) field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true, complexity: 12)
expect(field.to_graphql.complexity).to eq 12 expect(field.to_graphql.complexity).to eq 12
end end
it 'does not raise an error even with Gitaly calls' do it 'does not raise an error even with Gitaly calls' do
allow(Gitlab::GitalyClient).to receive(:get_request_count).and_return([0, 1]) allow(Gitlab::GitalyClient).to receive(:get_request_count).and_return([0, 1])
field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, null: true, complexity: 12) field = described_class.new(name: 'test', type: GraphQL::Types::String, null: true, complexity: 12)
expect(field.to_graphql.complexity).to eq 12 expect(field.to_graphql.complexity).to eq 12
end end
...@@ -123,7 +123,7 @@ RSpec.describe Types::BaseField do ...@@ -123,7 +123,7 @@ RSpec.describe Types::BaseField do
describe '#visible?' do describe '#visible?' do
context 'and has a feature_flag' do context 'and has a feature_flag' do
let(:flag) { :test_feature } let(:flag) { :test_feature }
let(:field) { described_class.new(name: 'test', type: GraphQL::STRING_TYPE, feature_flag: flag, null: false) } let(:field) { described_class.new(name: 'test', type: GraphQL::Types::String, feature_flag: flag, null: false) }
let(:context) { {} } let(:context) { {} }
before do before do
...@@ -156,7 +156,7 @@ RSpec.describe Types::BaseField do ...@@ -156,7 +156,7 @@ RSpec.describe Types::BaseField do
describe '#description' do describe '#description' do
context 'feature flag given' do context 'feature flag given' do
let(:field) { described_class.new(name: 'test', type: GraphQL::STRING_TYPE, feature_flag: flag, null: false, description: 'Test description.') } let(:field) { described_class.new(name: 'test', type: GraphQL::Types::String, feature_flag: flag, null: false, description: 'Test description.') }
let(:flag) { :test_flag } let(:flag) { :test_flag }
it 'prepends the description' do it 'prepends the description' do
...@@ -211,7 +211,7 @@ RSpec.describe Types::BaseField do ...@@ -211,7 +211,7 @@ RSpec.describe Types::BaseField do
include_examples 'Gitlab-style deprecations' do include_examples 'Gitlab-style deprecations' do
def subject(args = {}) def subject(args = {})
base_args = { name: 'test', type: GraphQL::STRING_TYPE, null: true } base_args = { name: 'test', type: GraphQL::Types::String, null: true }
described_class.new(**base_args.merge(args)) described_class.new(**base_args.merge(args))
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment