Commit 01ea8178 authored by Brett Walker's avatar Brett Walker

Convert old graphql types to newer types

in prep for interpreter
parent 5629c6c7
......@@ -28,55 +28,6 @@ Graphql/OldTypes:
Exclude:
- '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/resolvers/issues_resolver.rb'
- 'ee/app/graphql/ee/resolvers/namespace_projects_resolver.rb'
......
......@@ -6,7 +6,7 @@ module Types
graphql_name 'AccessLevel'
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.',
method: :to_i
......
......@@ -14,7 +14,7 @@ module Types
field :recorded_at, Types::TimeType, null: true,
description: 'The time the measurement was recorded.'
field :count, GraphQL::INT_TYPE, null: false,
field :count, GraphQL::Types::Int, null: false,
description: 'Object count.'
field :identifier, Types::Admin::Analytics::UsageTrends::MeasurementIdentifierEnum, null: false,
......
......@@ -10,17 +10,17 @@ module Types
description 'The response from the AdminSidekiqQueuesDeleteJobs mutation'
field :completed,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
null: true,
description: 'Whether or not the entire queue was processed in time; if not, retrying the same request is safe.'
field :deleted_jobs,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
null: true,
description: 'The number of matching jobs deleted.'
field :queue_size,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
null: true,
description: 'The queue size after processing.'
end
......
......@@ -11,18 +11,18 @@ module Types
::AlertManagement::Alert.status_names.each do |status|
field status,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
null: true,
description: "Number of alerts with status #{status.to_s.upcase} for the project"
end
field :open,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
null: true,
description: 'Number of alerts with status TRIGGERED or ACKNOWLEDGED for the project.'
field :all,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
null: true,
description: 'Total number of alerts for the project.'
end
......
......@@ -13,12 +13,12 @@ module Types
authorize :read_alert_management_alert
field :iid,
GraphQL::ID_TYPE,
GraphQL::Types::ID,
null: false,
description: 'Internal ID of the alert.'
field :issue_iid,
GraphQL::ID_TYPE,
GraphQL::Types::ID,
null: true,
deprecated: { reason: 'Use issue field', milestone: '13.10' },
description: 'Internal ID of the GitLab issue attached to the alert.'
......@@ -29,12 +29,12 @@ module Types
description: 'Issue attached to the alert.'
field :title,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Title of the alert.'
field :description,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Description of the alert.'
......@@ -50,17 +50,17 @@ module Types
method: :status_name
field :service,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Service the alert came from.'
field :monitoring_tool,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Monitoring tool the alert came from.'
field :hosts,
[GraphQL::STRING_TYPE],
[GraphQL::Types::String],
null: true,
description: 'List of hosts the alert came from.'
......@@ -80,7 +80,7 @@ module Types
description: 'Environment for the alert.'
field :event_count,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
null: true,
description: 'Number of events of this alert.',
method: :events
......@@ -106,12 +106,12 @@ module Types
description: 'Assignees of the alert.'
field :metrics_dashboard_url,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'URL for metrics embed for the alert.'
field :runbook,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Runbook for the alert as defined in alert details.'
......@@ -122,7 +122,7 @@ module Types
resolver: Resolvers::TodoResolver
field :details_url,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'The URL of the alert detail page.'
......
......@@ -7,7 +7,7 @@ module Types
graphql_name 'AlertManagementIntegration'
field :id,
GraphQL::ID_TYPE,
GraphQL::Types::ID,
null: false,
description: 'ID of the integration.'
......@@ -17,27 +17,27 @@ module Types
description: 'Type of integration.'
field :name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Name of the integration.'
field :active,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
null: true,
description: 'Whether the endpoint is currently accepting alerts.'
field :token,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Token used to authenticate alert notification requests.'
field :url,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Endpoint which accepts alert notifications.'
field :api_url,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'URL at which Prometheus metrics can be queried to populate the metrics dashboard.'
......
......@@ -11,27 +11,27 @@ module Types
present_using AwardEmojiPresenter
field :name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'The emoji name.'
field :description,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'The emoji description.'
field :unicode,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'The emoji in Unicode.'
field :emoji,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'The emoji as an icon.'
field :unicode_version,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'The Unicode version for this emoji.'
......
......@@ -9,30 +9,30 @@ module Types
description: 'Type of blob viewer.',
null: false
field :load_async, GraphQL::BOOLEAN_TYPE,
field :load_async, GraphQL::Types::Boolean,
description: 'Shows whether the blob content is loaded asynchronously.',
null: false
field :collapsed, GraphQL::BOOLEAN_TYPE,
field :collapsed, GraphQL::Types::Boolean,
description: 'Shows whether the blob should be displayed collapsed.',
method: :collapsed?,
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.',
method: :too_large?,
null: false
field :render_error, GraphQL::STRING_TYPE,
field :render_error, GraphQL::Types::String,
description: 'Error rendering the blob content.',
null: true
field :file_type, GraphQL::STRING_TYPE,
field :file_type, GraphQL::Types::String,
description: 'Content file type.',
method: :partial_name,
null: false
field :loading_partial_name, GraphQL::STRING_TYPE,
field :loading_partial_name, GraphQL::Types::String,
description: 'Loading partial name.',
null: false
......
......@@ -10,19 +10,19 @@ module Types
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.'
field :title, GraphQL::STRING_TYPE, null: false,
field :title, GraphQL::Types::String, null: false,
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.'
field :position, GraphQL::INT_TYPE, null: true,
field :position, GraphQL::Types::Int, null: true,
description: 'Position of list within the board.'
field :label, Types::LabelType, null: true,
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.'
field :issues_count, GraphQL::INT_TYPE, null: true,
field :issues_count, GraphQL::Types::Int, null: true,
description: 'Count of issues in the list.'
field :issues, ::Types::IssueType.connection_type, null: true,
......
......@@ -9,15 +9,15 @@ module Types
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.'
field :name, type: GraphQL::STRING_TYPE, null: true,
field :name, type: GraphQL::Types::String, null: true,
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.'
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.'
field :created_at, Types::TimeType, null: false,
......@@ -33,10 +33,10 @@ module Types
resolver: Resolvers::BoardListsResolver,
extras: [:lookahead]
field :web_path, GraphQL::STRING_TYPE, null: false,
field :web_path, GraphQL::Types::String, null: false,
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.'
end
end
......
......@@ -4,15 +4,15 @@ module Types
module Boards
# Common arguments that we can be used to filter boards epics and issues
class BoardIssuableInputBaseType < BaseInputObject
argument :label_name, [GraphQL::STRING_TYPE, null: true],
argument :label_name, [GraphQL::Types::String, null: true],
required: false,
description: 'Filter by label name.'
argument :author_username, GraphQL::STRING_TYPE,
argument :author_username, GraphQL::Types::String,
required: false,
description: 'Filter by author username.'
argument :my_reaction_emoji, GraphQL::STRING_TYPE,
argument :my_reaction_emoji, GraphQL::Types::String,
required: false,
description: 'Filter by reaction emoji applied by the current user.'
end
......
......@@ -4,19 +4,19 @@ module Types
module Boards
# rubocop: disable Graphql/AuthorizeTypes
class BoardIssueInputBaseType < BoardIssuableInputBaseType
argument :iids, [GraphQL::STRING_TYPE],
argument :iids, [GraphQL::Types::String],
required: false,
description: 'List of IIDs of issues. For example `["1", "2"]`.'
argument :milestone_title, GraphQL::STRING_TYPE,
argument :milestone_title, GraphQL::Types::String,
required: false,
description: 'Filter by milestone title.'
argument :assignee_username, [GraphQL::STRING_TYPE, null: true],
argument :assignee_username, [GraphQL::Types::String, null: true],
required: false,
description: 'Filter by assignee username.'
argument :release_tag, GraphQL::STRING_TYPE,
argument :release_tag, GraphQL::Types::String,
required: false,
description: 'Filter by release tag.'
end
......
......@@ -10,7 +10,7 @@ module Types
prepare: ->(negated_args, ctx) { negated_args.to_h },
description: 'List of negated arguments.'
argument :search, GraphQL::STRING_TYPE,
argument :search, GraphQL::Types::String,
required: false,
description: 'Search query for issue title or description.'
......
......@@ -6,7 +6,7 @@ module Types
graphql_name 'Branch'
field :name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'Name of the branch.'
......
......@@ -6,27 +6,27 @@ module Types
class AnalyticsType < BaseObject
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.'
field :week_pipelines_successful, [GraphQL::INT_TYPE], null: true,
field :week_pipelines_successful, [GraphQL::Types::Int], null: true,
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.'
field :month_pipelines_totals, [GraphQL::INT_TYPE], null: true,
field :month_pipelines_totals, [GraphQL::Types::Int], null: true,
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.'
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.'
field :year_pipelines_totals, [GraphQL::INT_TYPE], null: true,
field :year_pipelines_totals, [GraphQL::Types::Int], null: true,
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.'
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.'
field :pipeline_times_values, [GraphQL::INT_TYPE], null: true,
field :pipeline_times_values, [GraphQL::Types::Int], null: true,
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.'
end
end
......
......@@ -7,7 +7,7 @@ module Types
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.'
end
end
......
......@@ -7,9 +7,9 @@ module Types
class BuildNeedType < BaseObject
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.'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
description: 'Name of the job we need to complete.'
end
end
......
......@@ -7,16 +7,16 @@ module Types
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.',
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.',
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.',
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.',
method: :job_token_scope_enabled?
field :project, Types::ProjectType, null: true,
......
......@@ -7,9 +7,9 @@ module Types
class ConfigType < BaseObject
graphql_name 'CiConfig'
field :errors, [GraphQL::STRING_TYPE], null: true,
field :errors, [GraphQL::Types::String], null: true,
description: 'Linting errors.'
field :merged_yaml, GraphQL::STRING_TYPE, null: true,
field :merged_yaml, GraphQL::Types::String, null: true,
description: 'Merged CI configuration YAML.'
field :stages, Types::Ci::Config::StageType.connection_type, null: true,
description: 'Stages of the pipeline.'
......
......@@ -7,11 +7,11 @@ module Types
class GroupType < BaseObject
graphql_name 'CiConfigGroup'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
description: 'Name of the job group.'
field :jobs, Types::Ci::Config::JobType.connection_type, null: true,
description: 'Jobs in group.'
field :size, GraphQL::INT_TYPE, null: true,
field :size, GraphQL::Types::Int, null: true,
description: 'Size of the job group.'
end
end
......
......@@ -7,7 +7,7 @@ module Types
class JobRestrictionType < BaseObject
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.'
end
end
......
......@@ -7,32 +7,32 @@ module Types
class JobType < BaseObject
graphql_name 'CiConfigJob'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
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.'
field :stage, GraphQL::STRING_TYPE, null: true,
field :stage, GraphQL::Types::String, null: true,
description: 'Name of the job stage.'
field :needs, Types::Ci::Config::NeedType.connection_type, null: true,
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.'
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.'
field :script, [GraphQL::STRING_TYPE], null: true,
field :script, [GraphQL::Types::String], null: true,
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.'
field :when, GraphQL::STRING_TYPE, null: true,
field :when, GraphQL::Types::String, null: true,
description: 'When to run the job.',
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.'
field :except, Types::Ci::Config::JobRestrictionType, null: true,
description: 'Limit when jobs are not created.'
field :only, Types::Ci::Config::JobRestrictionType, null: true,
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.'
def restrict_when_to_run_jobs
......
......@@ -7,7 +7,7 @@ module Types
class NeedType < BaseObject
graphql_name 'CiConfigNeed'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
description: 'Name of the need.'
end
end
......
......@@ -7,7 +7,7 @@ module Types
class StageType < BaseObject
graphql_name 'CiConfigStage'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
description: 'Name of the stage.'
field :groups, Types::Ci::Config::GroupType.connection_type, null: true,
description: 'Groups of jobs for the stage.'
......
......@@ -6,26 +6,26 @@ module Types
class DetailedStatusType < BaseObject
graphql_name 'DetailedStatus'
field :id, GraphQL::STRING_TYPE, null: false,
field :id, GraphQL::Types::String, null: false,
description: 'ID for a detailed status.',
extras: [:parent]
field :group, GraphQL::STRING_TYPE, null: true,
field :group, GraphQL::Types::String, null: true,
description: 'Group of the status.'
field :icon, GraphQL::STRING_TYPE, null: true,
field :icon, GraphQL::Types::String, null: true,
description: 'Icon of the status.'
field :favicon, GraphQL::STRING_TYPE, null: true,
field :favicon, GraphQL::Types::String, null: true,
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.'
field :has_details, GraphQL::BOOLEAN_TYPE, null: true,
field :has_details, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the status has further details.',
method: :has_details?
field :label, GraphQL::STRING_TYPE, null: true,
field :label, GraphQL::Types::String, null: true,
calls_gitaly: true,
description: 'Label of the status.'
field :text, GraphQL::STRING_TYPE, null: true,
field :text, GraphQL::Types::String, null: true,
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.',
method: :status_tooltip
field :action, Types::Ci::StatusActionType, null: true,
......
......@@ -6,11 +6,11 @@ module Types
class GroupType < BaseObject
graphql_name 'CiGroup'
field :id, GraphQL::STRING_TYPE, null: false,
field :id, GraphQL::Types::String, null: false,
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.'
field :size, GraphQL::INT_TYPE, null: true,
field :size, GraphQL::Types::Int, null: true,
description: 'Size of the group.'
field :jobs, Ci::JobType.connection_type, null: true,
description: 'Jobs in group.'
......
......@@ -6,7 +6,7 @@ module Types
class JobArtifactType < BaseObject
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."
field :file_type, ::Types::Ci::JobArtifactFileTypeEnum, null: true,
......
......@@ -14,7 +14,7 @@ module Types
description: 'ID of the job.'
field :pipeline, Types::Ci::PipelineType, null: true,
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.'
field :needs, BuildNeedType.connection_type, null: true,
description: 'References to builds that must complete before the jobs run.'
......@@ -24,11 +24,11 @@ module Types
description: "Status of the job."
field :stage, Types::Ci::StageType, null: true,
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.'
field :duration, GraphQL::INT_TYPE, null: true,
field :duration, GraphQL::Types::Int, null: true,
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.'
# Life-cycle timestamps:
......@@ -53,33 +53,33 @@ module Types
description: 'Detailed status of the job.'
field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true,
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.'
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.'
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.'
field :ref_name, GraphQL::STRING_TYPE, null: true,
field :ref_name, GraphQL::Types::String, null: true,
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.'
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.'
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.'
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.'
field :active, GraphQL::BOOLEAN_TYPE, null: false, method: :active?,
field :active, GraphQL::Types::Boolean, null: false, method: :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.'
field :coverage, GraphQL::FLOAT_TYPE, null: true,
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.'
field :manual_job, GraphQL::BOOLEAN_TYPE, null: true,
field :manual_job, GraphQL::Types::Boolean, null: true,
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.'
def pipeline
......
......@@ -12,25 +12,25 @@ module Types
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.'
field :iid, GraphQL::STRING_TYPE, null: false,
field :iid, GraphQL::Types::String, null: false,
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."
field :before_sha, GraphQL::STRING_TYPE, null: true,
field :before_sha, GraphQL::Types::String, null: true,
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.'
field :status, PipelineStatusEnum, null: false,
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."
field :detailed_status, Types::Ci::DetailedStatusType, null: false,
......@@ -39,7 +39,7 @@ module Types
field :config_source, PipelineConfigSourceEnum, null: true,
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.'
field :queued_duration, Types::DurationType, null: true,
......@@ -76,12 +76,12 @@ module Types
null: true,
description: 'Pipeline user.'
field :retryable, GraphQL::BOOLEAN_TYPE,
field :retryable, GraphQL::Types::Boolean,
description: 'Specifies if a pipeline can be retried.',
method: :retryable?,
null: false
field :cancelable, GraphQL::BOOLEAN_TYPE,
field :cancelable, GraphQL::Types::Boolean,
description: 'Specifies if a pipeline can be canceled.',
method: :cancelable?,
null: false
......@@ -103,7 +103,7 @@ module Types
required: false,
description: 'ID of the job.'
argument :name,
type: ::GraphQL::STRING_TYPE,
type: ::GraphQL::Types::String,
required: false,
description: 'Name of the job.'
end
......@@ -122,19 +122,19 @@ module Types
description: 'Pipeline that triggered the 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."
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.'
field :project, Types::ProjectType, null: true,
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.'
field :uses_needs, GraphQL::BOOLEAN_TYPE, null: true,
field :uses_needs, GraphQL::Types::Boolean, null: true,
method: :uses_needs?,
description: 'Indicates if the pipeline has jobs with `needs` dependencies.'
......@@ -150,7 +150,7 @@ module Types
description: 'A specific test suite in a pipeline test report.',
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.'
def detailed_status
......
......@@ -9,10 +9,10 @@ module Types
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.'
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.'
end
# rubocop: enable Graphql/AuthorizeTypes
......
......@@ -6,9 +6,9 @@ module Types
class RunnerArchitectureType < BaseObject
graphql_name 'RunnerArchitecture'
field :name, GraphQL::STRING_TYPE, null: false,
field :name, GraphQL::Types::String, null: false,
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.'
end
end
......
......@@ -6,9 +6,9 @@ module Types
class RunnerPlatformType < BaseObject
graphql_name 'RunnerPlatform'
field :name, GraphQL::STRING_TYPE, null: false,
field :name, GraphQL::Types::String, null: false,
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.'
field :architectures, Types::Ci::RunnerArchitectureType.connection_type, null: true,
description: 'Runner architectures supported for the platform.'
......
......@@ -6,9 +6,9 @@ module Types
class RunnerSetupType < BaseObject
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.'
field :register_instructions, GraphQL::STRING_TYPE, null: true,
field :register_instructions, GraphQL::Types::String, null: true,
description: 'Instructions for registering the runner.'
end
end
......
......@@ -12,38 +12,38 @@ module Types
field :id, ::Types::GlobalIDType[::Ci::Runner], null: false,
description: 'ID of the runner.'
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
description: 'Description of the runner.'
field :contacted_at, Types::TimeType, null: true,
description: 'Last contact from the runner.',
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.'
field :access_level, ::Types::Ci::RunnerAccessLevelEnum, null: false,
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.'
field :status, ::Types::Ci::RunnerStatusEnum, null: false,
description: 'Status of the runner.'
field :version, GraphQL::STRING_TYPE, null: true,
field :version, GraphQL::Types::String, null: true,
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.)
field :revision, GraphQL::STRING_TYPE, null: true,
field :revision, GraphQL::Types::String, null: true,
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.'
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.'
field :ip_address, GraphQL::STRING_TYPE, null: true,
field :ip_address, GraphQL::Types::String, null: true,
description: 'IP address of the runner.'
field :runner_type, ::Types::Ci::RunnerTypeEnum, null: false,
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.'
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.'
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)."
def job_count
......
......@@ -6,9 +6,9 @@ module Types
graphql_name 'CiStage'
authorize :read_commit_status
field :id, GraphQL::ID_TYPE, null: false,
field :id, GraphQL::Types::ID, null: false,
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.'
field :groups, type: Ci::GroupType.connection_type, null: true,
extras: [:lookahead],
......@@ -18,7 +18,7 @@ module Types
field :jobs, Ci::JobType.connection_type, null: true,
description: 'Jobs for the stage.',
method: 'latest_statuses'
field :status, GraphQL::STRING_TYPE,
field :status, GraphQL::Types::String,
null: true,
description: 'Status of the pipeline stage.'
......
......@@ -5,19 +5,19 @@ module Types
class StatusActionType < BaseObject
graphql_name 'StatusAction'
field :id, GraphQL::STRING_TYPE, null: false,
field :id, GraphQL::Types::String, null: false,
description: 'ID for a status action.',
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.'
field :icon, GraphQL::STRING_TYPE, null: true,
field :icon, GraphQL::Types::String, null: true,
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.',
resolver_method: :action_method
field :path, GraphQL::STRING_TYPE, null: true,
field :path, GraphQL::Types::String, null: true,
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.'
def id(parent:)
......
......@@ -7,9 +7,9 @@ module Types
graphql_name 'CiTemplate'
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.'
field :content, GraphQL::STRING_TYPE, null: false,
field :content, GraphQL::Types::String, null: false,
description: 'Contents of the CI template.'
end
end
......
......@@ -12,25 +12,25 @@ module Types
field :status, Types::Ci::TestCaseStatusEnum, null: true,
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.'
field :classname, GraphQL::STRING_TYPE, null: true,
field :classname, GraphQL::Types::String, null: true,
description: 'Classname of the test case.'
field :execution_time, GraphQL::FLOAT_TYPE, null: true,
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.'
field :attachment_url, GraphQL::STRING_TYPE, null: true,
field :attachment_url, GraphQL::Types::String, null: true,
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.'
field :stack_trace, GraphQL::STRING_TYPE, null: true,
field :stack_trace, GraphQL::Types::String, null: true,
description: 'Stack trace of the test case.'
field :recent_failures, Types::Ci::RecentFailuresType, null: true,
......
......@@ -10,22 +10,22 @@ module Types
field :time, GraphQL::FLOAT_TYPE, null: true,
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.'
field :success, GraphQL::INT_TYPE, null: true,
field :success, GraphQL::Types::Int, null: true,
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.'
field :skipped, GraphQL::INT_TYPE, null: true,
field :skipped, GraphQL::Types::Int, null: true,
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.'
field :suite_error, GraphQL::STRING_TYPE, null: true,
field :suite_error, GraphQL::Types::String, null: true,
description: 'Test suite error message.'
end
# rubocop: enable Graphql/AuthorizeTypes
......
......@@ -9,31 +9,31 @@ module Types
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.'
field :total_time, GraphQL::FLOAT_TYPE, null: true,
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.'
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.'
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.'
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.'
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.'
field :suite_error, GraphQL::STRING_TYPE, null: true,
field :suite_error, GraphQL::Types::String, null: true,
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.'
end
# rubocop: enable Graphql/AuthorizeTypes
......
......@@ -9,28 +9,28 @@ module Types
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.'
field :total_time, GraphQL::FLOAT_TYPE, null: true,
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.'
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.'
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.'
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.'
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.'
field :suite_error, GraphQL::STRING_TYPE, null: true,
field :suite_error, GraphQL::Types::String, null: true,
description: 'Test suite error message.'
field :test_cases, Types::Ci::TestCaseType.connection_type, null: true,
......
......@@ -7,10 +7,10 @@ module Types
graphql_name 'SastCiConfigurationAnalyzersEntityInput'
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.'
argument :enabled, GraphQL::BOOLEAN_TYPE, required: true,
argument :enabled, GraphQL::Types::Boolean, required: true,
description: 'State of the analyzer.'
argument :variables, [::Types::CiConfiguration::Sast::EntityInputType],
......
......@@ -8,16 +8,16 @@ module Types
graphql_name 'SastCiConfigurationAnalyzersEntity'
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.'
field :label, GraphQL::STRING_TYPE, null: true,
field :label, GraphQL::Types::String, null: true,
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.'
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
description: 'Analyzer description that is displayed on the form.'
field :variables, ::Types::CiConfiguration::Sast::EntityType.connection_type, null: true,
......
......@@ -7,13 +7,13 @@ module Types
graphql_name 'SastCiConfigurationEntityInput'
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.'
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.'
argument :value, GraphQL::STRING_TYPE, required: true,
argument :value, GraphQL::Types::String, required: true,
description: 'Current value of the entity.'
end
end
......
......@@ -8,25 +8,25 @@ module Types
graphql_name 'SastCiConfigurationEntity'
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.'
field :label, GraphQL::STRING_TYPE, null: true,
field :label, GraphQL::Types::String, null: true,
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.'
field :options, ::Types::CiConfiguration::Sast::OptionsEntityType.connection_type, null: true,
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.'
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
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.'
field :size, ::Types::CiConfiguration::Sast::UiComponentSizeEnum, null: true,
......
......@@ -8,10 +8,10 @@ module Types
graphql_name 'SastCiConfigurationOptionsEntity'
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.'
field :value, GraphQL::STRING_TYPE, null: true,
field :value, GraphQL::Types::String, null: true,
description: 'Value of option entity.'
end
end
......
......@@ -4,15 +4,15 @@ module Types
class CommitActionType < BaseInputObject
argument :action, type: Types::CommitActionModeEnum, required: true,
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.'
argument :content, type: GraphQL::STRING_TYPE, required: false,
argument :content, type: GraphQL::Types::String, required: false,
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.'
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.'
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.'
argument :encoding, type: Types::CommitEncodingEnum, required: false,
description: 'Encoding of the file. Default is text.'
......
......@@ -8,31 +8,31 @@ module Types
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.'
field :sha, type: GraphQL::STRING_TYPE, null: false,
field :sha, type: GraphQL::Types::String, null: false,
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.'
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.'
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.'
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.'
field :authored_date, type: Types::TimeType, null: true,
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.'
field :web_path, type: GraphQL::STRING_TYPE, null: false,
field :web_path, type: GraphQL::Types::String, null: false,
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.'
field :author_name, type: GraphQL::STRING_TYPE, null: true,
field :author_name, type: GraphQL::Types::String, null: true,
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.'
# models/commit lazy loads the author by email
......
......@@ -10,7 +10,7 @@ module Types
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 :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 :cadence, Types::ContainerExpirationPolicyCadenceEnum, null: false, description: 'This container expiration policy schedule.'
field :keep_n, Types::ContainerExpirationPolicyKeepEnum, null: true, description: 'Number of tags to retain.'
......
......@@ -8,15 +8,15 @@ module Types
authorize :read_container_image
field :name, GraphQL::STRING_TYPE, null: false, description: 'Name of the tag.'
field :path, GraphQL::STRING_TYPE, null: false, description: 'Path of the tag.'
field :location, GraphQL::STRING_TYPE, null: false, description: 'URL of the tag.'
field :digest, GraphQL::STRING_TYPE, null: true, description: 'Digest of the tag.'
field :revision, GraphQL::STRING_TYPE, null: true, description: 'Revision of the tag.'
field :short_revision, GraphQL::STRING_TYPE, null: true, description: 'Short revision of the tag.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the tag.'
field :path, GraphQL::Types::String, null: false, description: 'Path of the tag.'
field :location, GraphQL::Types::String, null: false, description: 'URL of the tag.'
field :digest, GraphQL::Types::String, null: true, description: 'Digest of the tag.'
field :revision, GraphQL::Types::String, null: true, description: '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 :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
Ability.allowed?(current_user, :destroy_container_image, object)
......
......@@ -8,17 +8,17 @@ module Types
authorize :read_container_image
field :id, GraphQL::ID_TYPE, null: false, description: 'ID of the container repository.'
field :name, GraphQL::STRING_TYPE, null: false, description: 'Name of the container repository.'
field :path, GraphQL::STRING_TYPE, null: false, description: 'Path of the container repository.'
field :location, GraphQL::STRING_TYPE, null: false, description: 'URL of the container repository.'
field :id, GraphQL::Types::ID, null: false, description: 'ID of the container repository.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the container repository.'
field :path, GraphQL::Types::String, null: false, description: 'Path 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 :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_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 :tags_count, GraphQL::INT_TYPE, 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 :tags_count, GraphQL::Types::Int, null: false, description: 'Number of tags associated with this image.'
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.'
def can_delete
......
......@@ -3,7 +3,7 @@
module Types
# rubocop: disable Graphql/AuthorizeTypes
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.'
def count
......
......@@ -11,16 +11,16 @@ module Types
null: false,
description: 'The ID of the emoji.'
field :name, GraphQL::STRING_TYPE,
field :name, GraphQL::Types::String,
null: false,
description: 'The name of the emoji.'
field :url, GraphQL::STRING_TYPE,
field :url, GraphQL::Types::String,
null: false,
method: :file,
description: 'The link to file of the emoji.'
field :external, GraphQL::BOOLEAN_TYPE,
field :external, GraphQL::Types::Boolean,
null: false,
description: 'Whether the emoji is an external link.'
end
......
......@@ -17,7 +17,7 @@ RSpec.describe Types::BaseField do
end
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
end
......@@ -25,7 +25,7 @@ RSpec.describe Types::BaseField do
describe '#base_complexity' do
context 'with no gitaly calls' 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
end
......@@ -33,7 +33,7 @@ RSpec.describe Types::BaseField do
context 'with a gitaly call' 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
end
......@@ -41,14 +41,14 @@ RSpec.describe Types::BaseField do
end
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
end
context 'when field has a resolver' 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
expect(field.to_graphql.complexity).to eq 2
......@@ -56,7 +56,7 @@ RSpec.describe Types::BaseField do
end
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
expect(field.to_graphql.complexity.call({}, {}, 2)).to eq 4
......@@ -71,7 +71,7 @@ RSpec.describe Types::BaseField do
context 'and is not a connection' 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({}, { first: 50 }, 2)).to eq 2
......@@ -82,8 +82,8 @@ RSpec.describe Types::BaseField do
context 'calls_gitaly' do
context 'for fields with a resolver' 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)
without_gitaly_field = described_class.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: resolver, null: 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::Types::String, resolver_class: resolver, null: true)
base_result = without_gitaly_field.to_graphql.complexity.call({}, {}, 2)
expect(with_gitaly_field.to_graphql.complexity.call({}, {}, 2)).to eq base_result + 1
......@@ -92,28 +92,28 @@ RSpec.describe Types::BaseField do
context 'for fields without a resolver' 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
end
end
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
end
context 'with declared constant complexity value' 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
end
it 'does not raise an error even with Gitaly calls' do
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
end
......@@ -123,7 +123,7 @@ RSpec.describe Types::BaseField do
describe '#visible?' do
context 'and has a feature_flag' do
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) { {} }
before do
......@@ -156,7 +156,7 @@ RSpec.describe Types::BaseField do
describe '#description' 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 }
it 'prepends the description' do
......@@ -211,7 +211,7 @@ RSpec.describe Types::BaseField do
include_examples 'Gitlab-style deprecations' do
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))
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