Commit dcfe24e8 authored by Doug Stull's avatar Doug Stull

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

Convert old GraphQL types to newer type names (Part 1)

See merge request gitlab-org/gitlab!66461
parents 3093e341 d8917f7a
......@@ -28,33 +28,6 @@ Graphql/OldTypes:
Exclude:
- 'spec/**/*.rb'
- 'ee/spec/**/*.rb'
- 'app/graphql/mutations/admin/sidekiq_queues/delete_jobs.rb'
- 'app/graphql/mutations/alert_management/base.rb'
- 'app/graphql/mutations/alert_management/http_integration/create.rb'
- 'app/graphql/mutations/alert_management/http_integration/update.rb'
- 'app/graphql/mutations/alert_management/prometheus_integration/create.rb'
- 'app/graphql/mutations/alert_management/prometheus_integration/update.rb'
- 'app/graphql/mutations/award_emojis/base.rb'
- 'app/graphql/mutations/award_emojis/toggle.rb'
- 'app/graphql/mutations/boards/common_mutation_arguments.rb'
- 'app/graphql/mutations/boards/issues/issue_move_list.rb'
- 'app/graphql/mutations/boards/lists/base_create.rb'
- 'app/graphql/mutations/boards/lists/base_update.rb'
- 'app/graphql/mutations/branches/create.rb'
- 'app/graphql/mutations/ci/ci_cd_settings_update.rb'
- 'app/graphql/mutations/ci/job_token_scope/add_project.rb'
- 'app/graphql/mutations/ci/job_token_scope/remove_project.rb'
- 'app/graphql/mutations/ci/runner/update.rb'
- 'app/graphql/mutations/ci/runners_registration_token/reset.rb'
- 'app/graphql/mutations/commits/create.rb'
- 'app/graphql/mutations/concerns/mutations/can_mutate_spammable.rb'
- 'app/graphql/mutations/concerns/mutations/resolves_resource_parent.rb'
- 'app/graphql/mutations/concerns/mutations/resolves_subscription.rb'
- 'app/graphql/mutations/container_expiration_policies/update.rb'
- 'app/graphql/mutations/custom_emoji/create.rb'
- 'app/graphql/mutations/design_management/base.rb'
- 'app/graphql/mutations/discussions/toggle_resolve.rb'
- 'app/graphql/mutations/environments/canary_ingress/update.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'
......
......@@ -10,13 +10,13 @@ module Mutations
Gitlab::ApplicationContext::KNOWN_KEYS.each do |key|
argument key,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
required: false,
description: "Delete jobs matching #{key} in the context metadata"
end
argument :queue_name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
required: true,
description: 'The name of the queue to delete jobs from.'
......
......@@ -7,7 +7,7 @@ module Mutations
graphql_name 'AlertSetAssignees'
argument :assignee_usernames,
[GraphQL::STRING_TYPE],
[GraphQL::Types::String],
required: true,
description: 'The usernames to assign to the alert. Replaces existing assignees by default.'
......
......@@ -5,11 +5,11 @@ module Mutations
class Base < BaseMutation
include Gitlab::Utils::UsageData
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: "The project the alert to mutate is in."
argument :iid, GraphQL::STRING_TYPE,
argument :iid, GraphQL::Types::String,
required: true,
description: "The IID of the alert to mutate."
......
......@@ -8,15 +8,15 @@ module Mutations
graphql_name 'HttpIntegrationCreate'
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'The project to create the integration in.'
argument :name, GraphQL::STRING_TYPE,
argument :name, GraphQL::Types::String,
required: true,
description: 'The name of the integration.'
argument :active, GraphQL::BOOLEAN_TYPE,
argument :active, GraphQL::Types::Boolean,
required: true,
description: 'Whether the integration is receiving alerts.'
......
......@@ -10,11 +10,11 @@ module Mutations
required: true,
description: "The ID of the integration to mutate."
argument :name, GraphQL::STRING_TYPE,
argument :name, GraphQL::Types::String,
required: false,
description: "The name of the integration."
argument :active, GraphQL::BOOLEAN_TYPE,
argument :active, GraphQL::Types::Boolean,
required: false,
description: "Whether the integration is receiving alerts."
......
......@@ -8,15 +8,15 @@ module Mutations
graphql_name 'PrometheusIntegrationCreate'
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'The project to create the integration in.'
argument :active, GraphQL::BOOLEAN_TYPE,
argument :active, GraphQL::Types::Boolean,
required: true,
description: 'Whether the integration is receiving alerts.'
argument :api_url, GraphQL::STRING_TYPE,
argument :api_url, GraphQL::Types::String,
required: true,
description: 'Endpoint at which Prometheus can be queried.'
......
......@@ -10,11 +10,11 @@ module Mutations
required: true,
description: "The ID of the integration to mutate."
argument :active, GraphQL::BOOLEAN_TYPE,
argument :active, GraphQL::Types::Boolean,
required: false,
description: "Whether the integration is receiving alerts."
argument :api_url, GraphQL::STRING_TYPE,
argument :api_url, GraphQL::Types::String,
required: false,
description: "Endpoint at which Prometheus can be queried."
......
......@@ -15,7 +15,7 @@ module Mutations
description: 'The global ID of the awardable resource.'
argument :name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
required: true,
description: copy_field_description(Types::AwardEmojis::AwardEmojiType, :name)
......
......@@ -5,7 +5,7 @@ module Mutations
class Toggle < Base
graphql_name 'AwardEmojiToggle'
field :toggled_on, GraphQL::BOOLEAN_TYPE, null: false,
field :toggled_on, GraphQL::Types::Boolean, null: false,
description: 'Indicates the status of the emoji. ' \
'True if the toggle awarded the emoji, and false if the toggle removed the emoji.'
......
......@@ -11,7 +11,7 @@ module Mutations
field_class ::Types::BaseField
argument_class ::Types::BaseArgument
field :errors, [GraphQL::STRING_TYPE],
field :errors, [GraphQL::Types::String],
null: false,
description: 'Errors encountered during execution of the mutation.'
......
......@@ -7,15 +7,15 @@ module Mutations
included do
argument :name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
required: false,
description: 'The board name.'
argument :hide_backlog_list,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
required: false,
description: copy_field_description(Types::BoardType, :hide_backlog_list)
argument :hide_closed_list,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
required: false,
description: copy_field_description(Types::BoardType, :hide_closed_list)
end
......
......@@ -6,19 +6,19 @@ module Mutations
class IssueMoveList < Mutations::Issues::Base
graphql_name 'IssueMoveList'
BoardGID = ::Types::GlobalIDType[::Board]
ListID = ::GraphQL::ID_TYPE
IssueID = ::GraphQL::ID_TYPE
ListID = ::GraphQL::Types::ID
IssueID = ::GraphQL::Types::ID
argument :board_id, BoardGID,
required: true,
loads: Types::BoardType,
description: 'Global ID of the board that the issue is in.'
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project the issue to mutate is in.'
argument :iid, GraphQL::STRING_TYPE,
argument :iid, GraphQL::Types::String,
required: true,
description: 'IID of the issue to mutate.'
......
......@@ -4,7 +4,7 @@ module Mutations
module Boards
module Lists
class BaseCreate < BaseMutation
argument :backlog, GraphQL::BOOLEAN_TYPE,
argument :backlog, GraphQL::Types::Boolean,
required: false,
description: 'Create the backlog list.'
......
......@@ -4,11 +4,11 @@ module Mutations
module Boards
module Lists
class BaseUpdate < BaseMutation
argument :position, GraphQL::INT_TYPE,
argument :position, GraphQL::Types::Int,
required: false,
description: 'Position of list within the board.'
argument :collapsed, GraphQL::BOOLEAN_TYPE,
argument :collapsed, GraphQL::Types::Boolean,
required: false,
description: 'Indicates if the list is collapsed for this user.'
......
......@@ -7,16 +7,16 @@ module Mutations
graphql_name 'CreateBranch'
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project full path the branch is associated with.'
argument :name, GraphQL::STRING_TYPE,
argument :name, GraphQL::Types::String,
required: true,
description: 'Name of the branch.'
argument :ref,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
required: true,
description: 'Branch name or commit SHA to create branch from.'
......
......@@ -9,15 +9,15 @@ module Mutations
authorize :admin_project
argument :full_path, GraphQL::ID_TYPE,
argument :full_path, GraphQL::Types::ID,
required: true,
description: 'Full Path of the project the settings belong to.'
argument :keep_latest_artifact, GraphQL::BOOLEAN_TYPE,
argument :keep_latest_artifact, GraphQL::Types::Boolean,
required: false,
description: 'Indicates if the latest artifact should be kept for this project.'
argument :job_token_scope_enabled, GraphQL::BOOLEAN_TYPE,
argument :job_token_scope_enabled, GraphQL::Types::Boolean,
required: false,
description: 'Indicates CI job tokens generated in this project have restricted access to resources.'
......
......@@ -10,11 +10,11 @@ module Mutations
authorize :admin_project
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'The project that the CI job token scope belongs to.'
argument :target_project_path, GraphQL::ID_TYPE,
argument :target_project_path, GraphQL::Types::ID,
required: true,
description: 'The project to be added to the CI job token scope.'
......
......@@ -10,11 +10,11 @@ module Mutations
authorize :admin_project
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'The project that the CI job token scope belongs to.'
argument :target_project_path, GraphQL::ID_TYPE,
argument :target_project_path, GraphQL::Types::ID,
required: true,
description: 'The project to be removed from the CI job token scope.'
......
......@@ -14,11 +14,11 @@ module Mutations
required: true,
description: 'ID of the runner to update.'
argument :description, GraphQL::STRING_TYPE,
argument :description, GraphQL::Types::String,
required: false,
description: 'Description of the runner.'
argument :maximum_timeout, GraphQL::INT_TYPE,
argument :maximum_timeout, GraphQL::Types::Int,
required: false,
description: 'Maximum timeout (in seconds) for jobs processed by the runner.'
......@@ -26,18 +26,18 @@ module Mutations
required: false,
description: 'Access level of the runner.'
argument :active, GraphQL::BOOLEAN_TYPE,
argument :active, GraphQL::Types::Boolean,
required: false,
description: 'Indicates the runner is allowed to receive jobs.'
argument :locked, GraphQL::BOOLEAN_TYPE, required: false,
argument :locked, GraphQL::Types::Boolean, required: false,
description: 'Indicates the runner is locked.'
argument :run_untagged, GraphQL::BOOLEAN_TYPE,
argument :run_untagged, GraphQL::Types::Boolean,
required: false,
description: 'Indicates the runner is able to run untagged jobs.'
argument :tag_list, [GraphQL::STRING_TYPE], required: false,
argument :tag_list, [GraphQL::Types::String], required: false,
description: 'Tags associated with the runner.'
field :runner,
......
......@@ -8,7 +8,7 @@ module Mutations
authorize :update_runners_registration_token
ScopeID = ::GraphQL::ID_TYPE
ScopeID = ::GraphQL::Types::ID
argument :type, ::Types::Ci::RunnerTypeEnum,
required: true,
......@@ -19,7 +19,7 @@ module Mutations
description: 'ID of the project or group to reset the token for. Omit if resetting instance runner token.'
field :token,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'The runner token after mutation.'
......
......@@ -12,20 +12,20 @@ module Mutations
graphql_name 'CommitCreate'
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project full path the branch is associated with.'
argument :branch, GraphQL::STRING_TYPE,
argument :branch, GraphQL::Types::String,
required: true,
description: 'Name of the branch to commit into, it can be a new branch.'
argument :start_branch, GraphQL::STRING_TYPE,
argument :start_branch, GraphQL::Types::String,
required: false,
description: 'If on a new branch, name of the original branch.'
argument :message,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
required: true,
description: copy_field_description(Types::CommitType, :message)
......@@ -35,7 +35,7 @@ module Mutations
description: 'Array of action hashes to commit as a batch.'
field :commit_pipeline_path,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: "ETag path for the commit's pipeline."
......@@ -45,7 +45,7 @@ module Mutations
description: 'The commit after mutation.'
field :content,
[GraphQL::STRING_TYPE],
[GraphQL::Types::String],
null: true,
description: 'Contents of the commit.'
......
......@@ -6,7 +6,7 @@ module Mutations
included do
argument :assignee_usernames,
[GraphQL::STRING_TYPE],
[GraphQL::Types::String],
required: true,
description: 'The usernames to assign to the resource. Replaces existing assignees by default.'
......
......@@ -13,36 +13,36 @@ module Mutations
}.freeze
included do
argument :captcha_response, GraphQL::STRING_TYPE,
argument :captcha_response, GraphQL::Types::String,
required: false,
deprecated: DEPRECATION_NOTICE,
description: 'A valid CAPTCHA response value obtained by using the provided captchaSiteKey with a CAPTCHA API to present a challenge to be solved on the client. Required to resubmit if the previous operation returned "NeedsCaptchaResponse: true".'
argument :spam_log_id, GraphQL::INT_TYPE,
argument :spam_log_id, GraphQL::Types::Int,
required: false,
deprecated: DEPRECATION_NOTICE,
description: 'The spam log ID which must be passed along with a valid CAPTCHA response for the operation to be completed. Required to resubmit if the previous operation returned "NeedsCaptchaResponse: true".'
field :spam,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
null: true,
deprecated: DEPRECATION_NOTICE,
description: 'Indicates whether the operation was detected as definite spam. There is no option to resubmit the request with a CAPTCHA response.'
field :needs_captcha_response,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
null: true,
deprecated: DEPRECATION_NOTICE,
description: 'Indicates whether the operation was detected as possible spam and not completed. If CAPTCHA is enabled, the request must be resubmitted with a valid CAPTCHA response and spam_log_id included for the operation to be completed. Included only when an operation was not completed because "NeedsCaptchaResponse" is true.'
field :spam_log_id,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
null: true,
deprecated: DEPRECATION_NOTICE,
description: 'The spam log ID which must be passed along with a valid CAPTCHA response for an operation to be completed. Included only when an operation was not completed because "NeedsCaptchaResponse" is true.'
field :captcha_site_key,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
deprecated: DEPRECATION_NOTICE,
description: 'The CAPTCHA site key which must be used to render a challenge for the user to solve to obtain a valid captchaResponse value. Included only when an operation was not completed because "NeedsCaptchaResponse" is true.'
......
......@@ -7,11 +7,11 @@ module Mutations
include ResolvesProject
included do
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: false,
description: 'Full path of the project with which the resource is associated.'
argument :group_path, GraphQL::ID_TYPE,
argument :group_path, GraphQL::Types::ID,
required: false,
description: 'Full path of the group with which the resource is associated.'
end
......
......@@ -6,7 +6,7 @@ module Mutations
included do
argument :subscribed_state,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
required: true,
description: 'The desired state of the subscription.'
end
......
......@@ -10,12 +10,12 @@ module Mutations
authorize :destroy_container_image
argument :project_path,
GraphQL::ID_TYPE,
GraphQL::Types::ID,
required: true,
description: 'The project path where the container expiration policy is located.'
argument :enabled,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
required: false,
description: copy_field_description(Types::ContainerExpirationPolicyType, :enabled)
......
......@@ -17,7 +17,7 @@ module Mutations
description: 'ID of the container repository.'
argument :tag_names,
[GraphQL::STRING_TYPE],
[GraphQL::Types::String],
required: true,
description: "Container repository tag(s) to delete. Total number can't be greater than #{LIMIT}",
prepare: ->(tag_names, _) do
......@@ -27,7 +27,7 @@ module Mutations
end
field :deleted_tag_names,
[GraphQL::STRING_TYPE],
[GraphQL::Types::String],
description: 'Deleted container repository tags.',
null: false
......
......@@ -14,15 +14,15 @@ module Mutations
null: true,
description: 'The new custom emoji.'
argument :group_path, GraphQL::ID_TYPE,
argument :group_path, GraphQL::Types::ID,
required: true,
description: 'Namespace full path the emoji is associated with.'
argument :name, GraphQL::STRING_TYPE,
argument :name, GraphQL::Types::String,
required: true,
description: 'Name of the emoji.'
argument :url, GraphQL::STRING_TYPE,
argument :url, GraphQL::Types::String,
required: true,
as: :file,
description: 'Location of the emoji file.'
......
......@@ -5,11 +5,11 @@ module Mutations
class Base < ::Mutations::BaseMutation
include Mutations::ResolvesIssuable
argument :project_path, GraphQL::ID_TYPE,
argument :project_path, GraphQL::Types::ID,
required: true,
description: "The project where the issue is to upload designs for."
argument :iid, GraphQL::ID_TYPE,
argument :iid, GraphQL::Types::ID,
required: true,
description: "The IID of the issue to modify designs for."
......
......@@ -7,7 +7,7 @@ module Mutations
graphql_name "DesignManagementDelete"
argument :filenames, [GraphQL::STRING_TYPE],
argument :filenames, [GraphQL::Types::String],
required: true,
description: "The filenames of the designs to delete.",
prepare: ->(names, _ctx) do
......
......@@ -13,7 +13,7 @@ module Mutations
description: 'The global ID of the discussion.'
argument :resolve,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
required: true,
description: 'Will resolve the discussion when true, and unresolve the discussion when false.'
......
......@@ -11,18 +11,18 @@ module Mutations
DOC
argument :errors,
type: [::GraphQL::STRING_TYPE],
type: [::GraphQL::Types::String],
required: false,
description: 'Errors to return to the user.'
argument :messages,
type: [::GraphQL::STRING_TYPE],
type: [::GraphQL::Types::String],
as: :echoes,
required: false,
description: 'Messages to return to the user.'
field :echoes,
type: [::GraphQL::STRING_TYPE],
type: [::GraphQL::Types::String],
null: true,
description: 'Messages returned to the user.'
......
......@@ -14,7 +14,7 @@ module Mutations
description: 'The global ID of the environment to update.'
argument :weight,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
required: true,
description: 'The weight of the Canary Ingress.'
......
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