diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-23 12:09:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-23 12:09:05 +0000 |
commit | ab8eecd62cc11a31568b25304f5fd31c8b7f437f (patch) | |
tree | b73b765c3cea414112840fd8041c62f886d8ce53 /app/graphql | |
parent | 00a889ea7a115ebbda95a071dd630f93b79261e3 (diff) | |
download | gitlab-ce-ab8eecd62cc11a31568b25304f5fd31c8b7f437f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql')
27 files changed, 151 insertions, 115 deletions
diff --git a/app/graphql/mutations/packages/destroy_file.rb b/app/graphql/mutations/packages/destroy_file.rb new file mode 100644 index 00000000000..35a486666d5 --- /dev/null +++ b/app/graphql/mutations/packages/destroy_file.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Mutations + module Packages + class DestroyFile < ::Mutations::BaseMutation + graphql_name 'DestroyPackageFile' + + authorize :destroy_package + + argument :id, + ::Types::GlobalIDType[::Packages::PackageFile], + required: true, + description: 'ID of the Package file.' + + def resolve(id:) + package_file = authorized_find!(id: id) + + if package_file.destroy + return { errors: [] } + end + + { errors: package_file.errors.full_messages } + end + + private + + def find_object(id:) + # TODO: remove this line when the compatibility layer is removed + # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883 + id = ::Types::GlobalIDType[::Packages::PackageFile].coerce_isolated_input(id) + GitlabSchema.find_by_gid(id) + end + end + end +end diff --git a/app/graphql/types/mutation_type.rb b/app/graphql/types/mutation_type.rb index df693fafbb9..812943e0a1e 100644 --- a/app/graphql/types/mutation_type.rb +++ b/app/graphql/types/mutation_type.rb @@ -107,6 +107,7 @@ module Types mount_mutation Mutations::Namespace::PackageSettings::Update mount_mutation Mutations::UserCallouts::Create mount_mutation Mutations::Packages::Destroy + mount_mutation Mutations::Packages::DestroyFile mount_mutation Mutations::Echo end end diff --git a/app/graphql/types/query_complexity_type.rb b/app/graphql/types/query_complexity_type.rb index 82809fac22f..3f58a15aef7 100644 --- a/app/graphql/types/query_complexity_type.rb +++ b/app/graphql/types/query_complexity_type.rb @@ -9,7 +9,7 @@ module Types alias_method :query, :object - field :limit, GraphQL::INT_TYPE, + field :limit, GraphQL::Types::Int, null: true, method: :max_complexity, see: { @@ -18,7 +18,7 @@ module Types }, description: 'GraphQL query complexity limit.' - field :score, GraphQL::INT_TYPE, + field :score, GraphQL::Types::Int, null: true, description: 'GraphQL query complexity score.' diff --git a/app/graphql/types/release_asset_link_shared_input_arguments.rb b/app/graphql/types/release_asset_link_shared_input_arguments.rb index 4aa247e47cc..37a6cdd55c9 100644 --- a/app/graphql/types/release_asset_link_shared_input_arguments.rb +++ b/app/graphql/types/release_asset_link_shared_input_arguments.rb @@ -5,15 +5,15 @@ module Types extend ActiveSupport::Concern included do - argument :name, GraphQL::STRING_TYPE, + argument :name, GraphQL::Types::String, required: true, description: 'Name of the asset link.' - argument :url, GraphQL::STRING_TYPE, + argument :url, GraphQL::Types::String, required: true, description: 'URL of the asset link.' - argument :direct_asset_path, GraphQL::STRING_TYPE, + argument :direct_asset_path, GraphQL::Types::String, required: false, as: :filepath, description: 'Relative path for a direct asset link.' diff --git a/app/graphql/types/release_asset_link_type.rb b/app/graphql/types/release_asset_link_type.rb index 829e7e246db..02961f2f73f 100644 --- a/app/graphql/types/release_asset_link_type.rb +++ b/app/graphql/types/release_asset_link_type.rb @@ -7,20 +7,20 @@ module Types authorize :read_release - field :id, GraphQL::ID_TYPE, null: false, + field :id, GraphQL::Types::ID, null: false, description: 'ID of the link.' - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the link.' - field :url, GraphQL::STRING_TYPE, null: true, + field :url, GraphQL::Types::String, null: true, description: 'URL of the link.' field :link_type, Types::ReleaseAssetLinkTypeEnum, null: true, description: 'Type of the link: `other`, `runbook`, `image`, `package`; defaults to `other`.' - field :external, GraphQL::BOOLEAN_TYPE, null: true, method: :external?, + field :external, GraphQL::Types::Boolean, null: true, method: :external?, description: 'Indicates the link points to an external resource.' - field :direct_asset_url, GraphQL::STRING_TYPE, null: true, + field :direct_asset_url, GraphQL::Types::String, null: true, description: 'Direct asset URL of the link.' - field :direct_asset_path, GraphQL::STRING_TYPE, null: true, method: :filepath, + field :direct_asset_path, GraphQL::Types::String, null: true, method: :filepath, description: 'Relative path for the direct asset link.' def direct_asset_url diff --git a/app/graphql/types/release_assets_type.rb b/app/graphql/types/release_assets_type.rb index d847d9842d5..ea6ee0b5fd9 100644 --- a/app/graphql/types/release_assets_type.rb +++ b/app/graphql/types/release_assets_type.rb @@ -11,7 +11,7 @@ module Types present_using ReleasePresenter - field :count, GraphQL::INT_TYPE, null: true, method: :assets_count, + field :count, GraphQL::Types::Int, null: true, method: :assets_count, description: 'Number of assets of the release.' field :links, Types::ReleaseAssetLinkType.connection_type, null: true, method: :sorted_links, description: 'Asset links of the release.' diff --git a/app/graphql/types/release_links_type.rb b/app/graphql/types/release_links_type.rb index a51b80e1e13..7830e29f3cd 100644 --- a/app/graphql/types/release_links_type.rb +++ b/app/graphql/types/release_links_type.rb @@ -10,20 +10,20 @@ module Types present_using ReleasePresenter - field :self_url, GraphQL::STRING_TYPE, null: true, + field :self_url, GraphQL::Types::String, null: true, description: 'HTTP URL of the release.' - field :edit_url, GraphQL::STRING_TYPE, null: true, + field :edit_url, GraphQL::Types::String, null: true, description: "HTTP URL of the release's edit page.", authorize: :update_release - field :opened_merge_requests_url, GraphQL::STRING_TYPE, null: true, + field :opened_merge_requests_url, GraphQL::Types::String, null: true, description: 'HTTP URL of the merge request page, filtered by this release and `state=open`.' - field :merged_merge_requests_url, GraphQL::STRING_TYPE, null: true, + field :merged_merge_requests_url, GraphQL::Types::String, null: true, description: 'HTTP URL of the merge request page , filtered by this release and `state=merged`.' - field :closed_merge_requests_url, GraphQL::STRING_TYPE, null: true, + field :closed_merge_requests_url, GraphQL::Types::String, null: true, description: 'HTTP URL of the merge request page , filtered by this release and `state=closed`.' - field :opened_issues_url, GraphQL::STRING_TYPE, null: true, + field :opened_issues_url, GraphQL::Types::String, null: true, description: 'HTTP URL of the issues page, filtered by this release and `state=open`.' - field :closed_issues_url, GraphQL::STRING_TYPE, null: true, + field :closed_issues_url, GraphQL::Types::String, null: true, description: 'HTTP URL of the issues page, filtered by this release and `state=closed`.' end end diff --git a/app/graphql/types/release_source_type.rb b/app/graphql/types/release_source_type.rb index 10fc202514d..fd29a69d72a 100644 --- a/app/graphql/types/release_source_type.rb +++ b/app/graphql/types/release_source_type.rb @@ -7,9 +7,9 @@ module Types authorize :download_code - field :format, GraphQL::STRING_TYPE, null: true, + field :format, GraphQL::Types::String, null: true, description: 'Format of the source.' - field :url, GraphQL::STRING_TYPE, null: true, + field :url, GraphQL::Types::String, null: true, description: 'Download URL of the source.' end end diff --git a/app/graphql/types/release_type.rb b/app/graphql/types/release_type.rb index 81813a10a3e..5e8f00b2b0a 100644 --- a/app/graphql/types/release_type.rb +++ b/app/graphql/types/release_type.rb @@ -13,22 +13,22 @@ module Types present_using ReleasePresenter - field :tag_name, GraphQL::STRING_TYPE, null: true, method: :tag, + field :tag_name, GraphQL::Types::String, null: true, method: :tag, description: 'Name of the tag associated with the release.', authorize: :download_code - field :tag_path, GraphQL::STRING_TYPE, null: true, + field :tag_path, GraphQL::Types::String, null: true, description: 'Relative web path to the tag associated with the release.', authorize: :download_code - field :description, GraphQL::STRING_TYPE, null: true, + field :description, GraphQL::Types::String, null: true, description: 'Description (also known as "release notes") of the release.' markdown_field :description_html, null: true - field :name, GraphQL::STRING_TYPE, null: true, + field :name, GraphQL::Types::String, null: true, description: 'Name of the release.' field :created_at, Types::TimeType, null: true, description: 'Timestamp of when the release was created.' field :released_at, Types::TimeType, null: true, description: 'Timestamp of when the release was released.' - field :upcoming_release, GraphQL::BOOLEAN_TYPE, null: true, method: :upcoming_release?, + field :upcoming_release, GraphQL::Types::Boolean, null: true, method: :upcoming_release?, description: 'Indicates the release is an upcoming release.' field :assets, Types::ReleaseAssetsType, null: true, method: :itself, description: 'Assets of the release.' diff --git a/app/graphql/types/repository/blob_type.rb b/app/graphql/types/repository/blob_type.rb index 8ed97d7e663..b6a1a91fd7a 100644 --- a/app/graphql/types/repository/blob_type.rb +++ b/app/graphql/types/repository/blob_type.rb @@ -8,67 +8,67 @@ module Types graphql_name 'RepositoryBlob' - field :id, GraphQL::ID_TYPE, null: false, + field :id, GraphQL::Types::ID, null: false, description: 'ID of the blob.' - field :oid, GraphQL::STRING_TYPE, null: false, method: :id, + field :oid, GraphQL::Types::String, null: false, method: :id, description: 'OID of the blob.' - field :path, GraphQL::STRING_TYPE, null: false, + field :path, GraphQL::Types::String, null: false, description: 'Path of the blob.' - field :name, GraphQL::STRING_TYPE, + field :name, GraphQL::Types::String, description: 'Blob name.', null: true - field :mode, type: GraphQL::STRING_TYPE, + field :mode, type: GraphQL::Types::String, description: 'Blob mode.', null: true - field :lfs_oid, GraphQL::STRING_TYPE, null: true, + field :lfs_oid, GraphQL::Types::String, null: true, calls_gitaly: true, description: 'LFS OID of the blob.' - field :web_path, GraphQL::STRING_TYPE, null: true, + field :web_path, GraphQL::Types::String, null: true, description: 'Web path of the blob.' - field :ide_edit_path, GraphQL::STRING_TYPE, null: true, + field :ide_edit_path, GraphQL::Types::String, null: true, description: 'Web path to edit this blob in the Web IDE.' - field :fork_and_edit_path, GraphQL::STRING_TYPE, null: true, + field :fork_and_edit_path, GraphQL::Types::String, null: true, description: 'Web path to edit this blob using a forked project.' - field :ide_fork_and_edit_path, GraphQL::STRING_TYPE, null: true, + field :ide_fork_and_edit_path, GraphQL::Types::String, null: true, description: 'Web path to edit this blob in the Web IDE using a forked project.' - field :size, GraphQL::INT_TYPE, null: true, + field :size, GraphQL::Types::Int, null: true, description: 'Size (in bytes) of the blob.' - field :raw_size, GraphQL::INT_TYPE, null: true, + field :raw_size, GraphQL::Types::Int, null: true, description: 'Size (in bytes) of the blob, or the blob target if stored externally.' - field :raw_blob, GraphQL::STRING_TYPE, null: true, method: :data, + field :raw_blob, GraphQL::Types::String, null: true, method: :data, description: 'The raw content of the blob.' - field :raw_text_blob, GraphQL::STRING_TYPE, null: true, method: :text_only_data, + field :raw_text_blob, GraphQL::Types::String, null: true, method: :text_only_data, description: 'The raw content of the blob, if the blob is text data.' - field :stored_externally, GraphQL::BOOLEAN_TYPE, null: true, method: :stored_externally?, + field :stored_externally, GraphQL::Types::Boolean, null: true, method: :stored_externally?, description: "Whether the blob's content is stored externally (for instance, in LFS)." - field :edit_blob_path, GraphQL::STRING_TYPE, null: true, + field :edit_blob_path, GraphQL::Types::String, null: true, description: 'Web path to edit the blob in the old-style editor.' - field :raw_path, GraphQL::STRING_TYPE, null: true, + field :raw_path, GraphQL::Types::String, null: true, description: 'Web path to download the raw blob.' - field :external_storage_url, GraphQL::STRING_TYPE, null: true, + field :external_storage_url, GraphQL::Types::String, null: true, description: 'Web path to download the raw blob via external storage, if enabled.' - field :replace_path, GraphQL::STRING_TYPE, null: true, + field :replace_path, GraphQL::Types::String, null: true, description: 'Web path to replace the blob content.' - field :file_type, GraphQL::STRING_TYPE, null: true, + field :file_type, GraphQL::Types::String, null: true, description: 'The expected format of the blob based on the extension.' field :simple_viewer, type: Types::BlobViewerType, @@ -79,12 +79,12 @@ module Types description: 'Blob content rich viewer.', null: true - field :plain_data, GraphQL::STRING_TYPE, + field :plain_data, GraphQL::Types::String, description: 'Blob plain highlighted data.', null: true, calls_gitaly: true - field :can_modify_blob, GraphQL::BOOLEAN_TYPE, null: true, method: :can_modify_blob?, + field :can_modify_blob, GraphQL::Types::Boolean, null: true, method: :can_modify_blob?, calls_gitaly: true, description: 'Whether the current user can modify the blob.' diff --git a/app/graphql/types/repository_type.rb b/app/graphql/types/repository_type.rb index 9d896888fa7..466e3e45cb9 100644 --- a/app/graphql/types/repository_type.rb +++ b/app/graphql/types/repository_type.rb @@ -6,20 +6,20 @@ module Types authorize :download_code - field :root_ref, GraphQL::STRING_TYPE, null: true, calls_gitaly: true, + field :root_ref, GraphQL::Types::String, null: true, calls_gitaly: true, description: 'Default branch of the repository.' - field :empty, GraphQL::BOOLEAN_TYPE, null: false, method: :empty?, calls_gitaly: true, + field :empty, GraphQL::Types::Boolean, null: false, method: :empty?, calls_gitaly: true, description: 'Indicates repository has no visible content.' - field :exists, GraphQL::BOOLEAN_TYPE, null: false, method: :exists?, calls_gitaly: true, + field :exists, GraphQL::Types::Boolean, null: false, method: :exists?, calls_gitaly: true, description: 'Indicates a corresponding Git repository exists on disk.' field :tree, Types::Tree::TreeType, null: true, resolver: Resolvers::TreeResolver, calls_gitaly: true, description: 'Tree of the repository.' field :blobs, Types::Repository::BlobType.connection_type, null: true, resolver: Resolvers::BlobsResolver, calls_gitaly: true, description: 'Blobs contained within the repository' - field :branch_names, [GraphQL::STRING_TYPE], null: true, calls_gitaly: true, + field :branch_names, [GraphQL::Types::String], null: true, calls_gitaly: true, complexity: 170, description: 'Names of branches available in this repository that match the search pattern.', resolver: Resolvers::RepositoryBranchNamesResolver - field :disk_path, GraphQL::STRING_TYPE, + field :disk_path, GraphQL::Types::String, description: 'Shows a disk path of the repository.', null: true, authorize: :read_storage_disk_path diff --git a/app/graphql/types/resolvable_interface.rb b/app/graphql/types/resolvable_interface.rb index a9d745c2bc1..42784aa5e00 100644 --- a/app/graphql/types/resolvable_interface.rb +++ b/app/graphql/types/resolvable_interface.rb @@ -16,10 +16,10 @@ module Types Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.resolved_by_id).find end - field :resolved, GraphQL::BOOLEAN_TYPE, null: false, + field :resolved, GraphQL::Types::Boolean, null: false, description: 'Indicates if the object is resolved.', method: :resolved? - field :resolvable, GraphQL::BOOLEAN_TYPE, null: false, + field :resolvable, GraphQL::Types::Boolean, null: false, description: 'Indicates if the object can be resolved.', method: :resolvable? field :resolved_at, Types::TimeType, null: true, diff --git a/app/graphql/types/snippet_type.rb b/app/graphql/types/snippet_type.rb index 7606bdbc46d..c345aea08bd 100644 --- a/app/graphql/types/snippet_type.rb +++ b/app/graphql/types/snippet_type.rb @@ -17,7 +17,7 @@ module Types description: 'ID of the snippet.', null: false - field :title, GraphQL::STRING_TYPE, + field :title, GraphQL::Types::String, description: 'Title of the snippet.', null: false @@ -33,11 +33,11 @@ module Types description: 'The owner of the snippet.', null: true - field :file_name, GraphQL::STRING_TYPE, + field :file_name, GraphQL::Types::String, description: 'File Name of the snippet.', null: true - field :description, GraphQL::STRING_TYPE, + field :description, GraphQL::Types::String, description: 'Description of the snippet.', null: true @@ -53,11 +53,11 @@ module Types description: 'Timestamp this snippet was updated.', null: false - field :web_url, type: GraphQL::STRING_TYPE, + field :web_url, type: GraphQL::Types::String, description: 'Web URL of the snippet.', null: false - field :raw_url, type: GraphQL::STRING_TYPE, + field :raw_url, type: GraphQL::Types::String, description: 'Raw URL of the snippet.', null: false @@ -67,12 +67,12 @@ module Types null: true, resolver: Resolvers::Snippets::BlobsResolver - field :ssh_url_to_repo, type: GraphQL::STRING_TYPE, + field :ssh_url_to_repo, type: GraphQL::Types::String, description: 'SSH URL to the snippet repository.', calls_gitaly: true, null: true - field :http_url_to_repo, type: GraphQL::STRING_TYPE, + field :http_url_to_repo, type: GraphQL::Types::String, description: 'HTTP URL to the snippet repository.', calls_gitaly: true, null: true diff --git a/app/graphql/types/snippets/blob_action_input_type.rb b/app/graphql/types/snippets/blob_action_input_type.rb index 13eade3dcc4..45dc4be8451 100644 --- a/app/graphql/types/snippets/blob_action_input_type.rb +++ b/app/graphql/types/snippets/blob_action_input_type.rb @@ -10,15 +10,15 @@ module Types description: 'Type of input action.', required: true - argument :previous_path, GraphQL::STRING_TYPE, + argument :previous_path, GraphQL::Types::String, description: 'Previous path of the snippet file.', required: false - argument :file_path, GraphQL::STRING_TYPE, + argument :file_path, GraphQL::Types::String, description: 'Path of the snippet file.', required: true - argument :content, GraphQL::STRING_TYPE, + argument :content, GraphQL::Types::String, description: 'Snippet file content.', required: false end diff --git a/app/graphql/types/snippets/blob_type.rb b/app/graphql/types/snippets/blob_type.rb index 1335838935e..d5da271d936 100644 --- a/app/graphql/types/snippets/blob_type.rb +++ b/app/graphql/types/snippets/blob_type.rb @@ -8,36 +8,36 @@ module Types description 'Represents the snippet blob' present_using SnippetBlobPresenter - field :rich_data, GraphQL::STRING_TYPE, + field :rich_data, GraphQL::Types::String, description: 'Blob highlighted data.', null: true - field :plain_data, GraphQL::STRING_TYPE, + field :plain_data, GraphQL::Types::String, description: 'Blob plain highlighted data.', null: true - field :raw_plain_data, GraphQL::STRING_TYPE, + field :raw_plain_data, GraphQL::Types::String, description: 'The raw content of the blob, if the blob is text data.', null: true - field :raw_path, GraphQL::STRING_TYPE, + field :raw_path, GraphQL::Types::String, description: 'Blob raw content endpoint path.', null: false - field :size, GraphQL::INT_TYPE, + field :size, GraphQL::Types::Int, description: 'Blob size.', null: false - field :binary, GraphQL::BOOLEAN_TYPE, + field :binary, GraphQL::Types::Boolean, description: 'Shows whether the blob is binary.', method: :binary?, null: false - field :name, GraphQL::STRING_TYPE, + field :name, GraphQL::Types::String, description: 'Blob name.', null: true - field :path, GraphQL::STRING_TYPE, + field :path, GraphQL::Types::String, description: 'Blob path.', null: true @@ -49,15 +49,15 @@ module Types description: 'Blob content rich viewer.', null: true - field :mode, type: GraphQL::STRING_TYPE, + field :mode, type: GraphQL::Types::String, description: 'Blob mode.', null: true - field :external_storage, type: GraphQL::STRING_TYPE, + field :external_storage, type: GraphQL::Types::String, description: 'Blob external storage.', null: true - field :rendered_as_text, type: GraphQL::BOOLEAN_TYPE, + field :rendered_as_text, type: GraphQL::Types::Boolean, description: 'Shows whether the blob is rendered as text.', method: :rendered_as_text?, null: false diff --git a/app/graphql/types/task_completion_status.rb b/app/graphql/types/task_completion_status.rb index 6837256f202..3aa19ff9413 100644 --- a/app/graphql/types/task_completion_status.rb +++ b/app/graphql/types/task_completion_status.rb @@ -8,9 +8,9 @@ module Types graphql_name 'TaskCompletionStatus' description 'Completion status of tasks' - field :count, GraphQL::INT_TYPE, null: false, + field :count, GraphQL::Types::Int, null: false, description: 'Number of total tasks.' - field :completed_count, GraphQL::INT_TYPE, null: false, + field :completed_count, GraphQL::Types::Int, null: false, description: 'Number of completed tasks.' end # rubocop: enable Graphql/AuthorizeTypes diff --git a/app/graphql/types/terraform/state_type.rb b/app/graphql/types/terraform/state_type.rb index 9e2c47a9ece..cbd5aeaeef9 100644 --- a/app/graphql/types/terraform/state_type.rb +++ b/app/graphql/types/terraform/state_type.rb @@ -9,11 +9,11 @@ module Types connection_type_class(Types::CountableConnectionType) - field :id, GraphQL::ID_TYPE, + field :id, GraphQL::Types::ID, null: false, description: 'ID of the Terraform state.' - field :name, GraphQL::STRING_TYPE, + field :name, GraphQL::Types::String, null: false, description: 'Name of the Terraform state.' diff --git a/app/graphql/types/terraform/state_version_type.rb b/app/graphql/types/terraform/state_version_type.rb index 2cd2ec8dcda..545b3c0044d 100644 --- a/app/graphql/types/terraform/state_version_type.rb +++ b/app/graphql/types/terraform/state_version_type.rb @@ -9,7 +9,7 @@ module Types authorize :read_terraform_state - field :id, GraphQL::ID_TYPE, + field :id, GraphQL::Types::ID, null: false, description: 'ID of the Terraform state version.' @@ -17,7 +17,7 @@ module Types null: true, description: 'The user that created this version.' - field :download_path, GraphQL::STRING_TYPE, + field :download_path, GraphQL::Types::String, null: true, description: "URL for downloading the version's JSON file." @@ -25,7 +25,7 @@ module Types null: true, description: 'The job that created this version.' - field :serial, GraphQL::INT_TYPE, + field :serial, GraphQL::Types::Int, null: true, description: 'Serial number of the version.', method: :version diff --git a/app/graphql/types/timelog_type.rb b/app/graphql/types/timelog_type.rb index 925a522629e..fb5d4ca2dc0 100644 --- a/app/graphql/types/timelog_type.rb +++ b/app/graphql/types/timelog_type.rb @@ -12,7 +12,7 @@ module Types description: 'Timestamp of when the time tracked was spent at.' field :time_spent, - GraphQL::INT_TYPE, + GraphQL::Types::Int, null: false, description: 'The time spent displayed in seconds.' diff --git a/app/graphql/types/todo_type.rb b/app/graphql/types/todo_type.rb index 3b983060de2..24c110ce09b 100644 --- a/app/graphql/types/todo_type.rb +++ b/app/graphql/types/todo_type.rb @@ -9,7 +9,7 @@ module Types authorize :read_todo - field :id, GraphQL::ID_TYPE, + field :id, GraphQL::Types::ID, description: 'ID of the to-do item.', null: false @@ -35,7 +35,7 @@ module Types description: 'Target type of the to-do item.', null: false - field :body, GraphQL::STRING_TYPE, + field :body, GraphQL::Types::String, description: 'Body of the to-do item.', null: false, calls_gitaly: true # TODO This is only true when `target_type` is `Commit`. See https://gitlab.com/gitlab-org/gitlab/issues/34757#note_234752665 diff --git a/app/graphql/types/tree/blob_type.rb b/app/graphql/types/tree/blob_type.rb index d192c8d3c57..bb15d91a62f 100644 --- a/app/graphql/types/tree/blob_type.rb +++ b/app/graphql/types/tree/blob_type.rb @@ -10,14 +10,14 @@ module Types graphql_name 'Blob' - field :web_url, GraphQL::STRING_TYPE, null: true, + field :web_url, GraphQL::Types::String, null: true, description: 'Web URL of the blob.' - field :web_path, GraphQL::STRING_TYPE, null: true, + field :web_path, GraphQL::Types::String, null: true, description: 'Web path of the blob.' - field :lfs_oid, GraphQL::STRING_TYPE, null: true, + field :lfs_oid, GraphQL::Types::String, null: true, calls_gitaly: true, description: 'LFS ID of the blob.' - field :mode, GraphQL::STRING_TYPE, null: true, + field :mode, GraphQL::Types::String, null: true, description: 'Blob mode in numeric format.' def lfs_oid diff --git a/app/graphql/types/tree/entry_type.rb b/app/graphql/types/tree/entry_type.rb index c0150b77c55..1c612f91a5b 100644 --- a/app/graphql/types/tree/entry_type.rb +++ b/app/graphql/types/tree/entry_type.rb @@ -4,17 +4,17 @@ module Types module EntryType include Types::BaseInterface - field :id, GraphQL::ID_TYPE, null: false, + field :id, GraphQL::Types::ID, null: false, description: 'ID of the entry.' - field :sha, GraphQL::STRING_TYPE, null: false, + field :sha, GraphQL::Types::String, null: false, description: 'Last commit SHA for the entry.', method: :id - field :name, GraphQL::STRING_TYPE, null: false, + field :name, GraphQL::Types::String, null: false, description: 'Name of the entry.' field :type, Tree::TypeEnum, null: false, description: 'Type of tree entry.' - field :path, GraphQL::STRING_TYPE, null: false, + field :path, GraphQL::Types::String, null: false, description: 'Path of the entry.' - field :flat_path, GraphQL::STRING_TYPE, null: false, + field :flat_path, GraphQL::Types::String, null: false, description: 'Flat path of the entry.' end end diff --git a/app/graphql/types/tree/submodule_type.rb b/app/graphql/types/tree/submodule_type.rb index 519e866ebb0..05d8c1a951a 100644 --- a/app/graphql/types/tree/submodule_type.rb +++ b/app/graphql/types/tree/submodule_type.rb @@ -8,9 +8,9 @@ module Types graphql_name 'Submodule' - field :web_url, type: GraphQL::STRING_TYPE, null: true, + field :web_url, type: GraphQL::Types::String, null: true, description: 'Web URL for the sub-module.' - field :tree_url, type: GraphQL::STRING_TYPE, null: true, + field :tree_url, type: GraphQL::Types::String, null: true, description: 'Tree URL for the sub-module.' end # rubocop: enable Graphql/AuthorizeTypes diff --git a/app/graphql/types/tree/tree_entry_type.rb b/app/graphql/types/tree/tree_entry_type.rb index daf4b5421fb..998b3617574 100644 --- a/app/graphql/types/tree/tree_entry_type.rb +++ b/app/graphql/types/tree/tree_entry_type.rb @@ -11,9 +11,9 @@ module Types graphql_name 'TreeEntry' description 'Represents a directory' - field :web_url, GraphQL::STRING_TYPE, null: true, + field :web_url, GraphQL::Types::String, null: true, description: 'Web URL for the tree entry (directory).' - field :web_path, GraphQL::STRING_TYPE, null: true, + field :web_path, GraphQL::Types::String, null: true, description: 'Web path for the tree entry (directory).' end # rubocop: enable Graphql/AuthorizeTypes diff --git a/app/graphql/types/user_interface.rb b/app/graphql/types/user_interface.rb index e5abc033155..045f612691b 100644 --- a/app/graphql/types/user_interface.rb +++ b/app/graphql/types/user_interface.rb @@ -14,20 +14,20 @@ module Types method: :itself field :id, - type: GraphQL::ID_TYPE, + type: GraphQL::Types::ID, null: false, description: 'ID of the user.' field :bot, - type: GraphQL::BOOLEAN_TYPE, + type: GraphQL::Types::Boolean, null: false, description: 'Indicates if the user is a bot.', method: :bot? field :username, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, description: 'Username of the user. Unique within this instance of GitLab.' field :name, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, description: 'Human-readable name of the user.' field :state, @@ -35,24 +35,24 @@ module Types null: false, description: 'State of the user.' field :email, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: true, description: 'User email.', method: :public_email, deprecated: { reason: :renamed, replacement: 'User.publicEmail', milestone: '13.7' } field :public_email, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: true, description: "User's public email." field :avatar_url, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: true, description: "URL of the user's avatar." field :web_url, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, description: 'Web URL of the user.' field :web_path, - type: GraphQL::STRING_TYPE, + type: GraphQL::Types::String, null: false, description: 'Web path of the user.' field :todos, @@ -70,7 +70,7 @@ module Types null: true, description: 'User status.' field :location, - type: ::GraphQL::STRING_TYPE, + type: ::GraphQL::Types::String, null: true, description: 'The location of the user.' field :project_memberships, diff --git a/app/graphql/types/user_merge_request_interaction_type.rb b/app/graphql/types/user_merge_request_interaction_type.rb index b9ff489e0d6..ff6e83efbb2 100644 --- a/app/graphql/types/user_merge_request_interaction_type.rb +++ b/app/graphql/types/user_merge_request_interaction_type.rb @@ -13,14 +13,14 @@ module Types authorize :read_merge_request field :can_merge, - type: ::GraphQL::BOOLEAN_TYPE, + type: ::GraphQL::Types::Boolean, null: false, calls_gitaly: true, method: :can_merge?, description: 'Whether this user can merge this merge request.' field :can_update, - type: ::GraphQL::BOOLEAN_TYPE, + type: ::GraphQL::Types::Boolean, null: false, method: :can_update?, description: 'Whether this user can update this merge request.' @@ -31,13 +31,13 @@ module Types description: 'The state of the review by this user.' field :reviewed, - type: ::GraphQL::BOOLEAN_TYPE, + type: ::GraphQL::Types::Boolean, null: false, method: :reviewed?, description: 'Whether this user has provided a review for this merge request.' field :approved, - type: ::GraphQL::BOOLEAN_TYPE, + type: ::GraphQL::Types::Boolean, null: false, method: :approved?, description: 'Whether this user has approved this merge request.' diff --git a/app/graphql/types/user_status_type.rb b/app/graphql/types/user_status_type.rb index c1a736a3722..61abec0ba96 100644 --- a/app/graphql/types/user_status_type.rb +++ b/app/graphql/types/user_status_type.rb @@ -7,9 +7,9 @@ module Types markdown_field :message_html, null: true, description: 'HTML of the user status message' - field :message, GraphQL::STRING_TYPE, null: true, + field :message, GraphQL::Types::String, null: true, description: 'User status message.' - field :emoji, GraphQL::STRING_TYPE, null: true, + field :emoji, GraphQL::Types::String, null: true, description: 'String representation of emoji.' field :availability, Types::AvailabilityEnum, null: false, description: 'User availability status.' |