From 633c935ee13a028aff923cba470dd7fbde13c2d2 Mon Sep 17 00:00:00 2001 From: Brett Walker <bwalker@gitlab.com> Date: Fri, 11 Feb 2022 14:39:22 -0600 Subject: [PATCH] Move graphql_name call to beginning of class A change in graphql-ruby gem 1.13 changes how imput names are calculate. Having `graphql_name` called after any arguments are defined can cause naming issues. So just standardize on putting it at the top. --- .../alert_management/http_integration/create.rb | 4 ++-- .../prometheus_integration/create.rb | 4 ++-- app/graphql/mutations/boards/create.rb | 3 +-- app/graphql/mutations/branches/create.rb | 4 ++-- app/graphql/mutations/ci/ci_cd_settings_update.rb | 4 ++-- .../mutations/ci/job_token_scope/add_project.rb | 4 ++-- .../mutations/ci/job_token_scope/remove_project.rb | 4 ++-- app/graphql/mutations/clusters/agents/create.rb | 4 ++-- app/graphql/mutations/commits/create.rb | 4 ++-- .../container_expiration_policies/update.rb | 4 ++-- .../mutations/container_repositories/destroy_tags.rb | 5 ++--- app/graphql/mutations/custom_emoji/create.rb | 4 ++-- .../mutations/customer_relations/contacts/create.rb | 4 ++-- .../mutations/customer_relations/contacts/update.rb | 4 ++-- .../customer_relations/organizations/create.rb | 4 ++-- .../customer_relations/organizations/update.rb | 4 ++-- .../dependency_proxy/group_settings/update.rb | 4 ++-- .../image_ttl_group_policy/update.rb | 4 ++-- app/graphql/mutations/design_management/delete.rb | 4 ++-- app/graphql/mutations/groups/update.rb | 4 ++-- app/graphql/mutations/issues/create.rb | 4 ++-- app/graphql/mutations/issues/set_confidential.rb | 4 ++-- app/graphql/mutations/jira_import/import_users.rb | 4 ++-- app/graphql/mutations/jira_import/start.rb | 4 ++-- app/graphql/mutations/labels/create.rb | 4 ++-- app/graphql/mutations/merge_requests/accept.rb | 12 ++++++------ app/graphql/mutations/merge_requests/create.rb | 4 ++-- .../mutations/namespace/package_settings/update.rb | 4 ++-- app/graphql/mutations/release_asset_links/create.rb | 7 +++---- app/graphql/mutations/snippets/create.rb | 4 ++-- app/graphql/mutations/snippets/update.rb | 4 ++-- app/graphql/mutations/work_items/create.rb | 4 ++-- app/graphql/mutations/work_items/delete.rb | 3 +-- app/graphql/mutations/work_items/update.rb | 5 ++--- .../admin/analytics/usage_trends/measurement_type.rb | 3 ++- .../alert_management/prometheus_integration_type.rb | 4 ++-- app/graphql/types/board_list_type.rb | 4 ++-- app/graphql/types/ci/runner_type.rb | 5 +++-- app/graphql/types/group_invitation_type.rb | 6 +++--- app/graphql/types/group_member_type.rb | 6 +++--- app/graphql/types/merge_requests/assignee_type.rb | 5 +++-- app/graphql/types/merge_requests/reviewer_type.rb | 5 +++-- .../types/metrics/dashboards/annotation_type.rb | 2 +- app/graphql/types/mutation_type.rb | 4 ++-- app/graphql/types/notes/discussion_type.rb | 4 ++-- app/graphql/types/packages/package_details_type.rb | 5 +++-- app/graphql/types/permission_types/issue.rb | 2 +- app/graphql/types/permission_types/merge_request.rb | 9 +++++---- app/graphql/types/query_complexity_type.rb | 4 ++-- app/graphql/types/repository/blob_type.rb | 4 ++-- app/graphql/types/terraform/state_version_type.rb | 4 ++-- app/graphql/types/tree/blob_type.rb | 5 ++--- app/graphql/types/tree/submodule_type.rb | 4 ++-- app/graphql/types/tree/tree_entry_type.rb | 7 +++---- .../enabled_namespaces/bulk_enable.rb | 5 ++--- .../devops_adoption/enabled_namespaces/disable.rb | 5 ++--- .../devops_adoption/enabled_namespaces/enable.rb | 5 ++--- .../app_sec/fuzzing/api/ci_configuration/create.rb | 4 ++-- .../app_sec/fuzzing/coverage/corpus/create.rb | 4 ++-- .../graphql/mutations/boards/epic_boards/create.rb | 4 ++-- .../graphql/mutations/boards/epic_boards/update.rb | 4 ++-- ee/app/graphql/mutations/boards/epics/create.rb | 4 ++-- ee/app/graphql/mutations/dast/profiles/create.rb | 4 ++-- ee/app/graphql/mutations/dast/profiles/run.rb | 4 ++-- ee/app/graphql/mutations/dast/profiles/update.rb | 4 ++-- .../graphql/mutations/dast_on_demand_scans/create.rb | 4 ++-- .../mutations/dast_scanner_profiles/create.rb | 4 ++-- .../mutations/dast_scanner_profiles/delete.rb | 4 ++-- .../mutations/dast_scanner_profiles/update.rb | 4 ++-- .../graphql/mutations/dast_site_profiles/create.rb | 4 ++-- .../graphql/mutations/dast_site_profiles/update.rb | 4 ++-- ee/app/graphql/mutations/dast_site_tokens/create.rb | 4 ++-- .../mutations/dast_site_validations/create.rb | 4 ++-- .../mutations/dast_site_validations/revoke.rb | 4 ++-- ee/app/graphql/mutations/epics/add_issue.rb | 4 ++-- ee/app/graphql/mutations/epics/create.rb | 4 ++-- ee/app/graphql/mutations/epics/update.rb | 4 ++-- .../incident_management/escalation_policy/create.rb | 4 ++-- .../incident_management/oncall_rotation/create.rb | 4 ++-- .../incident_management/oncall_rotation/update.rb | 4 ++-- .../incident_management/oncall_schedule/create.rb | 4 ++-- ee/app/graphql/mutations/issues/promote_to_epic.rb | 4 ++-- .../graphql/mutations/iterations/cadences/create.rb | 4 ++-- ee/app/graphql/mutations/iterations/create.rb | 4 ++-- ee/app/graphql/mutations/iterations/update.rb | 4 ++-- ee/app/graphql/mutations/projects/set_locked.rb | 4 ++-- .../quality_management/test_cases/create.rb | 4 ++-- .../requirements_management/create_requirement.rb | 4 ++-- .../requirements_management/export_requirements.rb | 4 ++-- .../mutations/security/training_provider_update.rb | 4 ++-- .../assign_security_policy_project.rb | 5 ++--- .../security_policy/commit_scan_execution_policy.rb | 5 ++--- .../create_security_policy_project.rb | 5 ++--- .../unassign_security_policy_project.rb | 5 ++--- .../admin/cloud_licenses/current_license_type.rb | 4 ++-- .../cloud_licenses/license_history_entry_type.rb | 4 ++-- .../cloud_licenses/subscription_future_entry_type.rb | 6 +++--- ee/app/graphql/types/boards/epic_list_type.rb | 4 ++-- ee/app/graphql/types/dast_site_profile_type.rb | 4 ++-- ee/app/graphql/types/epic_type.rb | 5 +++-- .../types/geo/group_wiki_repository_registry_type.rb | 4 ++-- ee/app/graphql/types/geo/lfs_object_registry_type.rb | 4 ++-- .../types/geo/merge_request_diff_registry_type.rb | 4 ++-- .../graphql/types/geo/package_file_registry_type.rb | 4 ++-- .../types/geo/pages_deployment_registry_type.rb | 4 ++-- .../types/geo/pipeline_artifact_registry_type.rb | 4 ++-- .../types/geo/snippet_repository_registry_type.rb | 4 ++-- .../geo/terraform_state_version_registry_type.rb | 4 ++-- ee/app/graphql/types/geo/upload_registry_type.rb | 4 ++-- .../incident_management/oncall_rotation_type.rb | 4 ++-- ee/app/graphql/types/scan_type.rb | 4 ++-- ee/app/graphql/types/vulnerability_detail_type.rb | 4 ++-- ee/app/graphql/types/vulnerability_location_type.rb | 4 ++-- 113 files changed, 239 insertions(+), 246 deletions(-) diff --git a/app/graphql/mutations/alert_management/http_integration/create.rb b/app/graphql/mutations/alert_management/http_integration/create.rb index 04840ac43bd82..f8d1a383706f6 100644 --- a/app/graphql/mutations/alert_management/http_integration/create.rb +++ b/app/graphql/mutations/alert_management/http_integration/create.rb @@ -4,10 +4,10 @@ module Mutations module AlertManagement module HttpIntegration class Create < HttpIntegrationBase - include FindsProject - graphql_name 'HttpIntegrationCreate' + include FindsProject + argument :project_path, GraphQL::Types::ID, required: true, description: 'Project to create the integration in.' diff --git a/app/graphql/mutations/alert_management/prometheus_integration/create.rb b/app/graphql/mutations/alert_management/prometheus_integration/create.rb index 0153bd0e42a2d..9c3aefce033a8 100644 --- a/app/graphql/mutations/alert_management/prometheus_integration/create.rb +++ b/app/graphql/mutations/alert_management/prometheus_integration/create.rb @@ -4,10 +4,10 @@ module Mutations module AlertManagement module PrometheusIntegration class Create < PrometheusIntegrationBase - include FindsProject - graphql_name 'PrometheusIntegrationCreate' + include FindsProject + argument :project_path, GraphQL::Types::ID, required: true, description: 'Project to create the integration in.' diff --git a/app/graphql/mutations/boards/create.rb b/app/graphql/mutations/boards/create.rb index 080bf7c6e79da..773ba08a291e9 100644 --- a/app/graphql/mutations/boards/create.rb +++ b/app/graphql/mutations/boards/create.rb @@ -3,10 +3,9 @@ module Mutations module Boards class Create < ::Mutations::BaseMutation - include Mutations::ResolvesResourceParent - graphql_name 'CreateBoard' + include Mutations::ResolvesResourceParent include Mutations::Boards::CommonMutationArguments field :board, diff --git a/app/graphql/mutations/branches/create.rb b/app/graphql/mutations/branches/create.rb index 078c84bcdc00d..b851622bfde8b 100644 --- a/app/graphql/mutations/branches/create.rb +++ b/app/graphql/mutations/branches/create.rb @@ -3,10 +3,10 @@ module Mutations module Branches class Create < BaseMutation - include FindsProject - graphql_name 'CreateBranch' + include FindsProject + argument :project_path, GraphQL::Types::ID, required: true, description: 'Project full path the branch is associated with.' diff --git a/app/graphql/mutations/ci/ci_cd_settings_update.rb b/app/graphql/mutations/ci/ci_cd_settings_update.rb index 7bd38bc299821..dec90ced96213 100644 --- a/app/graphql/mutations/ci/ci_cd_settings_update.rb +++ b/app/graphql/mutations/ci/ci_cd_settings_update.rb @@ -3,10 +3,10 @@ module Mutations module Ci class CiCdSettingsUpdate < BaseMutation - include FindsProject - graphql_name 'CiCdSettingsUpdate' + include FindsProject + authorize :admin_project argument :full_path, GraphQL::Types::ID, diff --git a/app/graphql/mutations/ci/job_token_scope/add_project.rb b/app/graphql/mutations/ci/job_token_scope/add_project.rb index 41adcae2c8238..e16c08cb116c4 100644 --- a/app/graphql/mutations/ci/job_token_scope/add_project.rb +++ b/app/graphql/mutations/ci/job_token_scope/add_project.rb @@ -4,10 +4,10 @@ module Mutations module Ci module JobTokenScope class AddProject < BaseMutation - include FindsProject - graphql_name 'CiJobTokenScopeAddProject' + include FindsProject + authorize :admin_project argument :project_path, GraphQL::Types::ID, diff --git a/app/graphql/mutations/ci/job_token_scope/remove_project.rb b/app/graphql/mutations/ci/job_token_scope/remove_project.rb index dd6b2358dd5fd..f503b4f2f7aab 100644 --- a/app/graphql/mutations/ci/job_token_scope/remove_project.rb +++ b/app/graphql/mutations/ci/job_token_scope/remove_project.rb @@ -4,10 +4,10 @@ module Mutations module Ci module JobTokenScope class RemoveProject < BaseMutation - include FindsProject - graphql_name 'CiJobTokenScopeRemoveProject' + include FindsProject + authorize :admin_project argument :project_path, GraphQL::Types::ID, diff --git a/app/graphql/mutations/clusters/agents/create.rb b/app/graphql/mutations/clusters/agents/create.rb index 0896cc7b2035c..deaa9c2d6568c 100644 --- a/app/graphql/mutations/clusters/agents/create.rb +++ b/app/graphql/mutations/clusters/agents/create.rb @@ -4,12 +4,12 @@ module Mutations module Clusters module Agents class Create < BaseMutation + graphql_name 'CreateClusterAgent' + include FindsProject authorize :create_cluster - graphql_name 'CreateClusterAgent' - argument :project_path, GraphQL::Types::ID, required: true, description: 'Full path of the associated project for this cluster agent.' diff --git a/app/graphql/mutations/commits/create.rb b/app/graphql/mutations/commits/create.rb index 3eb1912dbc422..00ec64becc895 100644 --- a/app/graphql/mutations/commits/create.rb +++ b/app/graphql/mutations/commits/create.rb @@ -3,6 +3,8 @@ module Mutations module Commits class Create < BaseMutation + graphql_name 'CommitCreate' + include FindsProject class UrlHelpers @@ -10,8 +12,6 @@ class UrlHelpers include Gitlab::Routing end - graphql_name 'CommitCreate' - argument :project_path, GraphQL::Types::ID, required: true, description: 'Project full path the branch is associated with.' diff --git a/app/graphql/mutations/container_expiration_policies/update.rb b/app/graphql/mutations/container_expiration_policies/update.rb index db4acadfc38ba..762058acf3d8d 100644 --- a/app/graphql/mutations/container_expiration_policies/update.rb +++ b/app/graphql/mutations/container_expiration_policies/update.rb @@ -3,10 +3,10 @@ module Mutations module ContainerExpirationPolicies class Update < Mutations::BaseMutation - include FindsProject - graphql_name 'UpdateContainerExpirationPolicy' + include FindsProject + authorize :destroy_container_image argument :project_path, diff --git a/app/graphql/mutations/container_repositories/destroy_tags.rb b/app/graphql/mutations/container_repositories/destroy_tags.rb index c2737820d2248..7777f903516b7 100644 --- a/app/graphql/mutations/container_repositories/destroy_tags.rb +++ b/app/graphql/mutations/container_repositories/destroy_tags.rb @@ -3,12 +3,11 @@ module Mutations module ContainerRepositories class DestroyTags < ::Mutations::ContainerRepositories::DestroyBase - LIMIT = 20 + graphql_name 'DestroyContainerRepositoryTags' + LIMIT = 20 TOO_MANY_TAGS_ERROR_MESSAGE = "Number of tags is greater than #{LIMIT}" - graphql_name 'DestroyContainerRepositoryTags' - authorize :destroy_container_image argument :id, diff --git a/app/graphql/mutations/custom_emoji/create.rb b/app/graphql/mutations/custom_emoji/create.rb index ad392d6c81490..269ea6c999981 100644 --- a/app/graphql/mutations/custom_emoji/create.rb +++ b/app/graphql/mutations/custom_emoji/create.rb @@ -3,10 +3,10 @@ module Mutations module CustomEmoji class Create < BaseMutation - include Mutations::ResolvesGroup - graphql_name 'CreateCustomEmoji' + include Mutations::ResolvesGroup + authorize :create_custom_emoji field :custom_emoji, diff --git a/app/graphql/mutations/customer_relations/contacts/create.rb b/app/graphql/mutations/customer_relations/contacts/create.rb index 3495f30f22753..96dc047c3dbf2 100644 --- a/app/graphql/mutations/customer_relations/contacts/create.rb +++ b/app/graphql/mutations/customer_relations/contacts/create.rb @@ -4,11 +4,11 @@ module Mutations module CustomerRelations module Contacts class Create < BaseMutation + graphql_name 'CustomerRelationsContactCreate' + include ResolvesIds include Gitlab::Graphql::Authorize::AuthorizeResource - graphql_name 'CustomerRelationsContactCreate' - field :contact, Types::CustomerRelations::ContactType, null: true, diff --git a/app/graphql/mutations/customer_relations/contacts/update.rb b/app/graphql/mutations/customer_relations/contacts/update.rb index e2f671058f0bb..a3abf37f21f65 100644 --- a/app/graphql/mutations/customer_relations/contacts/update.rb +++ b/app/graphql/mutations/customer_relations/contacts/update.rb @@ -4,10 +4,10 @@ module Mutations module CustomerRelations module Contacts class Update < Mutations::BaseMutation - include ResolvesIds - graphql_name 'CustomerRelationsContactUpdate' + include ResolvesIds + authorize :admin_crm_contact field :contact, diff --git a/app/graphql/mutations/customer_relations/organizations/create.rb b/app/graphql/mutations/customer_relations/organizations/create.rb index 17e0e9ad459e4..43c50a9fb30cc 100644 --- a/app/graphql/mutations/customer_relations/organizations/create.rb +++ b/app/graphql/mutations/customer_relations/organizations/create.rb @@ -4,11 +4,11 @@ module Mutations module CustomerRelations module Organizations class Create < BaseMutation + graphql_name 'CustomerRelationsOrganizationCreate' + include ResolvesIds include Gitlab::Graphql::Authorize::AuthorizeResource - graphql_name 'CustomerRelationsOrganizationCreate' - field :organization, Types::CustomerRelations::OrganizationType, null: true, diff --git a/app/graphql/mutations/customer_relations/organizations/update.rb b/app/graphql/mutations/customer_relations/organizations/update.rb index 21fcf565239e7..0c05541dbd701 100644 --- a/app/graphql/mutations/customer_relations/organizations/update.rb +++ b/app/graphql/mutations/customer_relations/organizations/update.rb @@ -4,10 +4,10 @@ module Mutations module CustomerRelations module Organizations class Update < Mutations::BaseMutation - include ResolvesIds - graphql_name 'CustomerRelationsOrganizationUpdate' + include ResolvesIds + authorize :admin_crm_organization field :organization, diff --git a/app/graphql/mutations/dependency_proxy/group_settings/update.rb b/app/graphql/mutations/dependency_proxy/group_settings/update.rb index d10e43cde293e..65c919db3c322 100644 --- a/app/graphql/mutations/dependency_proxy/group_settings/update.rb +++ b/app/graphql/mutations/dependency_proxy/group_settings/update.rb @@ -4,10 +4,10 @@ module Mutations module DependencyProxy module GroupSettings class Update < Mutations::BaseMutation - include Mutations::ResolvesGroup - graphql_name 'UpdateDependencyProxySettings' + include Mutations::ResolvesGroup + authorize :admin_dependency_proxy argument :group_path, diff --git a/app/graphql/mutations/dependency_proxy/image_ttl_group_policy/update.rb b/app/graphql/mutations/dependency_proxy/image_ttl_group_policy/update.rb index a5eb114b2da22..79d7a93c4e255 100644 --- a/app/graphql/mutations/dependency_proxy/image_ttl_group_policy/update.rb +++ b/app/graphql/mutations/dependency_proxy/image_ttl_group_policy/update.rb @@ -4,10 +4,10 @@ module Mutations module DependencyProxy module ImageTtlGroupPolicy class Update < Mutations::BaseMutation - include Mutations::ResolvesGroup - graphql_name 'UpdateDependencyProxyImageTtlGroupPolicy' + include Mutations::ResolvesGroup + authorize :admin_dependency_proxy argument :group_path, diff --git a/app/graphql/mutations/design_management/delete.rb b/app/graphql/mutations/design_management/delete.rb index 4e9f0aad93496..9e6431106286c 100644 --- a/app/graphql/mutations/design_management/delete.rb +++ b/app/graphql/mutations/design_management/delete.rb @@ -3,10 +3,10 @@ module Mutations module DesignManagement class Delete < Base - Errors = ::Gitlab::Graphql::Errors - graphql_name "DesignManagementDelete" + Errors = ::Gitlab::Graphql::Errors + argument :filenames, [GraphQL::Types::String], required: true, description: "Filenames of the designs to delete.", diff --git a/app/graphql/mutations/groups/update.rb b/app/graphql/mutations/groups/update.rb index 9c5628a57cd84..be7a14d0b438e 100644 --- a/app/graphql/mutations/groups/update.rb +++ b/app/graphql/mutations/groups/update.rb @@ -3,10 +3,10 @@ module Mutations module Groups class Update < Mutations::BaseMutation - include Mutations::ResolvesGroup - graphql_name 'GroupUpdate' + include Mutations::ResolvesGroup + authorize :admin_group field :group, Types::GroupType, diff --git a/app/graphql/mutations/issues/create.rb b/app/graphql/mutations/issues/create.rb index 1f1df9ff6367c..6bf8caf82d789 100644 --- a/app/graphql/mutations/issues/create.rb +++ b/app/graphql/mutations/issues/create.rb @@ -3,12 +3,12 @@ module Mutations module Issues class Create < BaseMutation + graphql_name 'CreateIssue' + include Mutations::SpamProtection include FindsProject include CommonMutationArguments - graphql_name 'CreateIssue' - authorize :create_issue argument :project_path, GraphQL::Types::ID, diff --git a/app/graphql/mutations/issues/set_confidential.rb b/app/graphql/mutations/issues/set_confidential.rb index 35e629ddc90de..abfd6fec0bdf0 100644 --- a/app/graphql/mutations/issues/set_confidential.rb +++ b/app/graphql/mutations/issues/set_confidential.rb @@ -3,10 +3,10 @@ module Mutations module Issues class SetConfidential < Base - include Mutations::SpamProtection - graphql_name 'IssueSetConfidential' + include Mutations::SpamProtection + argument :confidential, GraphQL::Types::Boolean, required: true, diff --git a/app/graphql/mutations/jira_import/import_users.rb b/app/graphql/mutations/jira_import/import_users.rb index 8d82a058dd0ed..b3874caee61a2 100644 --- a/app/graphql/mutations/jira_import/import_users.rb +++ b/app/graphql/mutations/jira_import/import_users.rb @@ -3,10 +3,10 @@ module Mutations module JiraImport class ImportUsers < BaseMutation - include FindsProject - graphql_name 'JiraImportUsers' + include FindsProject + authorize :admin_project field :jira_users, diff --git a/app/graphql/mutations/jira_import/start.rb b/app/graphql/mutations/jira_import/start.rb index 4929d6f394a89..ea071c45bcfb4 100644 --- a/app/graphql/mutations/jira_import/start.rb +++ b/app/graphql/mutations/jira_import/start.rb @@ -3,10 +3,10 @@ module Mutations module JiraImport class Start < BaseMutation - include FindsProject - graphql_name 'JiraImportStart' + include FindsProject + authorize :admin_project field :jira_import, diff --git a/app/graphql/mutations/labels/create.rb b/app/graphql/mutations/labels/create.rb index cb3ba7939aebe..3cd41dc01deb9 100644 --- a/app/graphql/mutations/labels/create.rb +++ b/app/graphql/mutations/labels/create.rb @@ -3,10 +3,10 @@ module Mutations module Labels class Create < BaseMutation - include Mutations::ResolvesResourceParent - graphql_name 'LabelCreate' + include Mutations::ResolvesResourceParent + field :label, Types::LabelType, null: true, diff --git a/app/graphql/mutations/merge_requests/accept.rb b/app/graphql/mutations/merge_requests/accept.rb index 7ce850901afbe..ebd9e2b8fdd8d 100644 --- a/app/graphql/mutations/merge_requests/accept.rb +++ b/app/graphql/mutations/merge_requests/accept.rb @@ -3,12 +3,6 @@ module Mutations module MergeRequests class Accept < Base - NOT_MERGEABLE = 'This branch cannot be merged' - HOOKS_VALIDATION_ERROR = 'Pre-merge hooks failed' - SHA_MISMATCH = 'The merge-head is not at the anticipated SHA' - MERGE_FAILED = 'The merge failed' - ALREADY_SCHEDULED = 'The merge request is already scheduled to be merged' - graphql_name 'MergeRequestAccept' authorize :accept_merge_request description <<~DESC @@ -17,6 +11,12 @@ class Accept < Base immediately if possible, or using one of the automatic merge strategies. DESC + NOT_MERGEABLE = 'This branch cannot be merged' + HOOKS_VALIDATION_ERROR = 'Pre-merge hooks failed' + SHA_MISMATCH = 'The merge-head is not at the anticipated SHA' + MERGE_FAILED = 'The merge failed' + ALREADY_SCHEDULED = 'The merge request is already scheduled to be merged' + argument :strategy, ::Types::MergeStrategyEnum, required: false, diff --git a/app/graphql/mutations/merge_requests/create.rb b/app/graphql/mutations/merge_requests/create.rb index dc1d5a22bc931..2883c02a6716f 100644 --- a/app/graphql/mutations/merge_requests/create.rb +++ b/app/graphql/mutations/merge_requests/create.rb @@ -3,10 +3,10 @@ module Mutations module MergeRequests class Create < BaseMutation - include FindsProject - graphql_name 'MergeRequestCreate' + include FindsProject + argument :project_path, GraphQL::Types::ID, required: true, description: 'Project full path the merge request is associated with.' diff --git a/app/graphql/mutations/namespace/package_settings/update.rb b/app/graphql/mutations/namespace/package_settings/update.rb index 400169d6b641f..934b75193d7f0 100644 --- a/app/graphql/mutations/namespace/package_settings/update.rb +++ b/app/graphql/mutations/namespace/package_settings/update.rb @@ -4,10 +4,10 @@ module Mutations module Namespace module PackageSettings class Update < Mutations::BaseMutation - include Mutations::ResolvesNamespace - graphql_name 'UpdateNamespacePackageSettings' + include Mutations::ResolvesNamespace + authorize :create_package_settings argument :namespace_path, diff --git a/app/graphql/mutations/release_asset_links/create.rb b/app/graphql/mutations/release_asset_links/create.rb index db486640507b9..f6445514ce94f 100644 --- a/app/graphql/mutations/release_asset_links/create.rb +++ b/app/graphql/mutations/release_asset_links/create.rb @@ -3,14 +3,13 @@ module Mutations module ReleaseAssetLinks class Create < BaseMutation - include FindsProject - graphql_name 'ReleaseAssetLinkCreate' - authorize :create_release - + include FindsProject include Types::ReleaseAssetLinkSharedInputArguments + authorize :create_release + argument :project_path, GraphQL::Types::ID, required: true, description: 'Full path of the project the asset link is associated with.' diff --git a/app/graphql/mutations/snippets/create.rb b/app/graphql/mutations/snippets/create.rb index c01b0e4a01b2e..850e05b52c1af 100644 --- a/app/graphql/mutations/snippets/create.rb +++ b/app/graphql/mutations/snippets/create.rb @@ -3,14 +3,14 @@ module Mutations module Snippets class Create < BaseMutation + graphql_name 'CreateSnippet' + include ServiceCompatibility include CanMutateSpammable include Mutations::SpamProtection authorize :create_snippet - graphql_name 'CreateSnippet' - field :snippet, Types::SnippetType, null: true, diff --git a/app/graphql/mutations/snippets/update.rb b/app/graphql/mutations/snippets/update.rb index 9ecaa8d4bf2b2..aa0fa5d533091 100644 --- a/app/graphql/mutations/snippets/update.rb +++ b/app/graphql/mutations/snippets/update.rb @@ -3,12 +3,12 @@ module Mutations module Snippets class Update < Base + graphql_name 'UpdateSnippet' + include ServiceCompatibility include CanMutateSpammable include Mutations::SpamProtection - graphql_name 'UpdateSnippet' - argument :id, ::Types::GlobalIDType[::Snippet], required: true, description: 'Global ID of the snippet to update.' diff --git a/app/graphql/mutations/work_items/create.rb b/app/graphql/mutations/work_items/create.rb index 3e76239396af1..a5d713d70b587 100644 --- a/app/graphql/mutations/work_items/create.rb +++ b/app/graphql/mutations/work_items/create.rb @@ -3,11 +3,11 @@ module Mutations module WorkItems class Create < BaseMutation + graphql_name 'WorkItemCreate' + include Mutations::SpamProtection include FindsProject - graphql_name 'WorkItemCreate' - authorize :create_work_item argument :description, GraphQL::Types::String, diff --git a/app/graphql/mutations/work_items/delete.rb b/app/graphql/mutations/work_items/delete.rb index 6a3e651bdd5c4..71792a802c061 100644 --- a/app/graphql/mutations/work_items/delete.rb +++ b/app/graphql/mutations/work_items/delete.rb @@ -3,11 +3,10 @@ module Mutations module WorkItems class Delete < BaseMutation + graphql_name 'WorkItemDelete' description "Deletes a work item." \ " Available only when feature flag `work_items` is enabled. The feature is experimental and is subject to change without notice." - graphql_name 'WorkItemDelete' - authorize :delete_work_item argument :id, ::Types::GlobalIDType[::WorkItem], diff --git a/app/graphql/mutations/work_items/update.rb b/app/graphql/mutations/work_items/update.rb index 2c0d45dfc04ab..3ab9ba2d502be 100644 --- a/app/graphql/mutations/work_items/update.rb +++ b/app/graphql/mutations/work_items/update.rb @@ -3,12 +3,11 @@ module Mutations module WorkItems class Update < BaseMutation - include Mutations::SpamProtection - + graphql_name 'WorkItemUpdate' description "Updates a work item by Global ID." \ " Available only when feature flag `work_items` is enabled. The feature is experimental and is subject to change without notice." - graphql_name 'WorkItemUpdate' + include Mutations::SpamProtection authorize :update_work_item diff --git a/app/graphql/types/admin/analytics/usage_trends/measurement_type.rb b/app/graphql/types/admin/analytics/usage_trends/measurement_type.rb index 8276549ddcc37..1fc47303d671c 100644 --- a/app/graphql/types/admin/analytics/usage_trends/measurement_type.rb +++ b/app/graphql/types/admin/analytics/usage_trends/measurement_type.rb @@ -5,10 +5,11 @@ module Admin module Analytics module UsageTrends class MeasurementType < BaseObject - include Gitlab::Graphql::Authorize::AuthorizeResource graphql_name 'UsageTrendsMeasurement' description 'Represents a recorded measurement (object count) for the Admins' + include Gitlab::Graphql::Authorize::AuthorizeResource + authorize :read_usage_trends_measurement field :recorded_at, Types::TimeType, null: true, diff --git a/app/graphql/types/alert_management/prometheus_integration_type.rb b/app/graphql/types/alert_management/prometheus_integration_type.rb index 27e4832d8f641..9a2ef78eca70b 100644 --- a/app/graphql/types/alert_management/prometheus_integration_type.rb +++ b/app/graphql/types/alert_management/prometheus_integration_type.rb @@ -3,11 +3,11 @@ module Types module AlertManagement class PrometheusIntegrationType < ::Types::BaseObject - include ::Gitlab::Routing - graphql_name 'AlertManagementPrometheusIntegration' description 'An endpoint and credentials used to accept Prometheus alerts for a project' + include ::Gitlab::Routing + implements(Types::AlertManagement::IntegrationType) authorize :admin_project diff --git a/app/graphql/types/board_list_type.rb b/app/graphql/types/board_list_type.rb index 8c67803e39e17..733006369eaa9 100644 --- a/app/graphql/types/board_list_type.rb +++ b/app/graphql/types/board_list_type.rb @@ -3,11 +3,11 @@ module Types # rubocop: disable Graphql/AuthorizeTypes class BoardListType < BaseObject - include Gitlab::Utils::StrongMemoize - graphql_name 'BoardList' description 'Represents a list for an issue board' + include Gitlab::Utils::StrongMemoize + alias_method :list, :object field :id, GraphQL::Types::ID, diff --git a/app/graphql/types/ci/runner_type.rb b/app/graphql/types/ci/runner_type.rb index e13b93dcf0e3c..f3b7b067c9353 100644 --- a/app/graphql/types/ci/runner_type.rb +++ b/app/graphql/types/ci/runner_type.rb @@ -3,12 +3,13 @@ module Types module Ci class RunnerType < BaseObject + graphql_name 'CiRunner' + edge_type_class(RunnerWebUrlEdge) connection_type_class(Types::CountableConnectionType) - graphql_name 'CiRunner' + authorize :read_runner present_using ::Ci::RunnerPresenter - expose_permissions Types::PermissionTypes::Ci::Runner JOB_COUNT_LIMIT = 1000 diff --git a/app/graphql/types/group_invitation_type.rb b/app/graphql/types/group_invitation_type.rb index 9410253553c9e..48281dcfd9f7b 100644 --- a/app/graphql/types/group_invitation_type.rb +++ b/app/graphql/types/group_invitation_type.rb @@ -2,14 +2,14 @@ module Types class GroupInvitationType < BaseObject + graphql_name 'GroupInvitation' + description 'Represents a Group Invitation' + expose_permissions Types::PermissionTypes::Group authorize :admin_group implements InvitationInterface - graphql_name 'GroupInvitation' - description 'Represents a Group Invitation' - field :group, Types::GroupType, null: true, description: 'Group that a User is invited to.' diff --git a/app/graphql/types/group_member_type.rb b/app/graphql/types/group_member_type.rb index 8b8e69d795d4a..d68abc11bbace 100644 --- a/app/graphql/types/group_member_type.rb +++ b/app/graphql/types/group_member_type.rb @@ -2,14 +2,14 @@ module Types class GroupMemberType < BaseObject + graphql_name 'GroupMember' + description 'Represents a Group Membership' + expose_permissions Types::PermissionTypes::Group authorize :read_group implements MemberInterface - graphql_name 'GroupMember' - description 'Represents a Group Membership' - field :group, Types::GroupType, null: true, description: 'Group that a User is a member of.' diff --git a/app/graphql/types/merge_requests/assignee_type.rb b/app/graphql/types/merge_requests/assignee_type.rb index 8448477370e32..24321d057a33b 100644 --- a/app/graphql/types/merge_requests/assignee_type.rb +++ b/app/graphql/types/merge_requests/assignee_type.rb @@ -3,11 +3,12 @@ module Types module MergeRequests class AssigneeType < ::Types::UserType + graphql_name 'MergeRequestAssignee' + description 'A user assigned to a merge request.' + include FindClosest include ::Types::MergeRequests::InteractsWithMergeRequest - graphql_name 'MergeRequestAssignee' - description 'A user assigned to a merge request.' authorize :read_user end end diff --git a/app/graphql/types/merge_requests/reviewer_type.rb b/app/graphql/types/merge_requests/reviewer_type.rb index 1ced821c83952..11f7ceaf461ee 100644 --- a/app/graphql/types/merge_requests/reviewer_type.rb +++ b/app/graphql/types/merge_requests/reviewer_type.rb @@ -3,11 +3,12 @@ module Types module MergeRequests class ReviewerType < ::Types::UserType + graphql_name 'MergeRequestReviewer' + description 'A user assigned to a merge request as a reviewer.' + include FindClosest include ::Types::MergeRequests::InteractsWithMergeRequest - graphql_name 'MergeRequestReviewer' - description 'A user assigned to a merge request as a reviewer.' authorize :read_user end end diff --git a/app/graphql/types/metrics/dashboards/annotation_type.rb b/app/graphql/types/metrics/dashboards/annotation_type.rb index fb35f2bd9a1ba..0c787476f5431 100644 --- a/app/graphql/types/metrics/dashboards/annotation_type.rb +++ b/app/graphql/types/metrics/dashboards/annotation_type.rb @@ -4,8 +4,8 @@ module Types module Metrics module Dashboards class AnnotationType < ::Types::BaseObject - authorize :read_metrics_dashboard_annotation graphql_name 'MetricsDashboardAnnotation' + authorize :read_metrics_dashboard_annotation field :description, GraphQL::Types::String, null: true, description: 'Description of the annotation.' diff --git a/app/graphql/types/mutation_type.rb b/app/graphql/types/mutation_type.rb index bcf64b79a852c..d16a7c77320cc 100644 --- a/app/graphql/types/mutation_type.rb +++ b/app/graphql/types/mutation_type.rb @@ -2,10 +2,10 @@ module Types class MutationType < BaseObject - include Gitlab::Graphql::MountMutation - graphql_name 'Mutation' + include Gitlab::Graphql::MountMutation + mount_mutation Mutations::Admin::SidekiqQueues::DeleteJobs mount_mutation Mutations::AlertManagement::CreateAlertIssue mount_mutation Mutations::AlertManagement::UpdateAlertStatus diff --git a/app/graphql/types/notes/discussion_type.rb b/app/graphql/types/notes/discussion_type.rb index 56579c357a7ec..ffe61c9ff88b9 100644 --- a/app/graphql/types/notes/discussion_type.rb +++ b/app/graphql/types/notes/discussion_type.rb @@ -3,10 +3,10 @@ module Types module Notes class DiscussionType < BaseObject - DiscussionID = ::Types::GlobalIDType[::Discussion] - graphql_name 'Discussion' + DiscussionID = ::Types::GlobalIDType[::Discussion] + authorize :read_note implements(Types::ResolvableInterface) diff --git a/app/graphql/types/packages/package_details_type.rb b/app/graphql/types/packages/package_details_type.rb index 3c64a52aa49af..444ecb5e79235 100644 --- a/app/graphql/types/packages/package_details_type.rb +++ b/app/graphql/types/packages/package_details_type.rb @@ -3,10 +3,11 @@ module Types module Packages class PackageDetailsType < PackageType - include ::PackagesHelper - graphql_name 'PackageDetailsType' description 'Represents a package details in the Package Registry. Note that this type is in beta and susceptible to changes' + + include ::PackagesHelper + authorize :read_package field :versions, ::Types::Packages::PackageType.connection_type, null: true, diff --git a/app/graphql/types/permission_types/issue.rb b/app/graphql/types/permission_types/issue.rb index 94e1bffd68527..b38971b64cd7c 100644 --- a/app/graphql/types/permission_types/issue.rb +++ b/app/graphql/types/permission_types/issue.rb @@ -3,8 +3,8 @@ module Types module PermissionTypes class Issue < BasePermissionType - description 'Check permissions for the current user on a issue' graphql_name 'IssuePermissions' + description 'Check permissions for the current user on a issue' abilities :read_issue, :admin_issue, :update_issue, :reopen_issue, :read_design, :create_design, :destroy_design, diff --git a/app/graphql/types/permission_types/merge_request.rb b/app/graphql/types/permission_types/merge_request.rb index 52c11fe558867..73a2f820f7965 100644 --- a/app/graphql/types/permission_types/merge_request.rb +++ b/app/graphql/types/permission_types/merge_request.rb @@ -3,15 +3,16 @@ module Types module PermissionTypes class MergeRequest < BasePermissionType + graphql_name 'MergeRequestPermissions' + description 'Check permissions for the current user on a merge request' + + present_using MergeRequestPresenter + PERMISSION_FIELDS = %i[push_to_source_branch remove_source_branch cherry_pick_on_current_merge_request revert_on_current_merge_request].freeze - present_using MergeRequestPresenter - description 'Check permissions for the current user on a merge request' - graphql_name 'MergeRequestPermissions' - abilities :read_merge_request, :admin_merge_request, :update_merge_request, :create_note diff --git a/app/graphql/types/query_complexity_type.rb b/app/graphql/types/query_complexity_type.rb index 3f58a15aef702..13b618cf5cea8 100644 --- a/app/graphql/types/query_complexity_type.rb +++ b/app/graphql/types/query_complexity_type.rb @@ -3,10 +3,10 @@ module Types # rubocop: disable Graphql/AuthorizeTypes class QueryComplexityType < ::Types::BaseObject - ANALYZER = GraphQL::Analysis::QueryComplexity.new { |_query, complexity| complexity } - graphql_name 'QueryComplexity' + ANALYZER = GraphQL::Analysis::QueryComplexity.new { |_query, complexity| complexity } + alias_method :query, :object field :limit, GraphQL::Types::Int, diff --git a/app/graphql/types/repository/blob_type.rb b/app/graphql/types/repository/blob_type.rb index 6a1adc478a50c..bfd59763a0725 100644 --- a/app/graphql/types/repository/blob_type.rb +++ b/app/graphql/types/repository/blob_type.rb @@ -4,10 +4,10 @@ module Repository # rubocop: disable Graphql/AuthorizeTypes # This is presented through `Repository` that has its own authorization class BlobType < BaseObject - present_using BlobPresenter - graphql_name 'RepositoryBlob' + present_using BlobPresenter + field :id, GraphQL::Types::ID, null: false, description: 'ID of the blob.' diff --git a/app/graphql/types/terraform/state_version_type.rb b/app/graphql/types/terraform/state_version_type.rb index bf1af4565bc90..59da550aa1bb5 100644 --- a/app/graphql/types/terraform/state_version_type.rb +++ b/app/graphql/types/terraform/state_version_type.rb @@ -3,10 +3,10 @@ module Types module Terraform class StateVersionType < BaseObject - include ::API::Helpers::RelatedResourcesHelpers - graphql_name 'TerraformStateVersion' + include ::API::Helpers::RelatedResourcesHelpers + authorize :read_terraform_state field :id, GraphQL::Types::ID, diff --git a/app/graphql/types/tree/blob_type.rb b/app/graphql/types/tree/blob_type.rb index bb15d91a62fa4..bcff65be652b9 100644 --- a/app/graphql/types/tree/blob_type.rb +++ b/app/graphql/types/tree/blob_type.rb @@ -4,12 +4,11 @@ module Tree # rubocop: disable Graphql/AuthorizeTypes # This is presented through `Repository` that has its own authorization class BlobType < BaseObject - implements Types::Tree::EntryType + graphql_name 'Blob' + implements Types::Tree::EntryType present_using BlobPresenter - graphql_name 'Blob' - field :web_url, GraphQL::Types::String, null: true, description: 'Web URL of the blob.' field :web_path, GraphQL::Types::String, null: true, diff --git a/app/graphql/types/tree/submodule_type.rb b/app/graphql/types/tree/submodule_type.rb index 05d8c1a951abf..bc7828dbffac9 100644 --- a/app/graphql/types/tree/submodule_type.rb +++ b/app/graphql/types/tree/submodule_type.rb @@ -4,10 +4,10 @@ module Tree # rubocop: disable Graphql/AuthorizeTypes # This is presented through `Repository` that has its own authorization class SubmoduleType < BaseObject - implements Types::Tree::EntryType - graphql_name 'Submodule' + implements Types::Tree::EntryType + field :web_url, type: GraphQL::Types::String, null: true, description: 'Web URL for the sub-module.' field :tree_url, type: GraphQL::Types::String, null: true, diff --git a/app/graphql/types/tree/tree_entry_type.rb b/app/graphql/types/tree/tree_entry_type.rb index 998b361757427..cdc84c8e31862 100644 --- a/app/graphql/types/tree/tree_entry_type.rb +++ b/app/graphql/types/tree/tree_entry_type.rb @@ -4,13 +4,12 @@ module Tree # rubocop: disable Graphql/AuthorizeTypes # This is presented through `Repository` that has its own authorization class TreeEntryType < BaseObject - implements Types::Tree::EntryType - - present_using TreeEntryPresenter - graphql_name 'TreeEntry' description 'Represents a directory' + implements Types::Tree::EntryType + present_using TreeEntryPresenter + field :web_url, GraphQL::Types::String, null: true, description: 'Web URL for the tree entry (directory).' field :web_path, GraphQL::Types::String, null: true, diff --git a/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/bulk_enable.rb b/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/bulk_enable.rb index 1109e7f8b126a..e3ba6b59910ff 100644 --- a/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/bulk_enable.rb +++ b/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/bulk_enable.rb @@ -5,12 +5,11 @@ module Analytics module DevopsAdoption module EnabledNamespaces class BulkEnable < BaseMutation - include Mixins::CommonMethods - graphql_name 'BulkEnableDevopsAdoptionNamespaces' - description '**BETA** This endpoint is subject to change without notice.' + include Mixins::CommonMethods + argument :namespace_ids, [::Types::GlobalIDType[::Namespace]], required: true, description: 'List of Namespace IDs.' diff --git a/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/disable.rb b/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/disable.rb index 24b8622ae163f..07ac6d7d9e8cb 100644 --- a/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/disable.rb +++ b/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/disable.rb @@ -5,12 +5,11 @@ module Analytics module DevopsAdoption module EnabledNamespaces class Disable < BaseMutation - include Mixins::CommonMethods - graphql_name 'DisableDevopsAdoptionNamespace' - description '**BETA** This endpoint is subject to change without notice.' + include Mixins::CommonMethods + argument :id, [::Types::GlobalIDType[::Analytics::DevopsAdoption::EnabledNamespace]], required: true, description: 'One or many IDs of the enabled namespaces to disable.' diff --git a/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/enable.rb b/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/enable.rb index e4840805ae40b..16dc53a8c9a53 100644 --- a/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/enable.rb +++ b/ee/app/graphql/mutations/analytics/devops_adoption/enabled_namespaces/enable.rb @@ -5,12 +5,11 @@ module Analytics module DevopsAdoption module EnabledNamespaces class Enable < BaseMutation - include Mixins::CommonMethods - graphql_name 'EnableDevopsAdoptionNamespace' - description '**BETA** This endpoint is subject to change without notice.' + include Mixins::CommonMethods + argument :namespace_id, ::Types::GlobalIDType[::Namespace], required: true, description: 'Namespace ID.' diff --git a/ee/app/graphql/mutations/app_sec/fuzzing/api/ci_configuration/create.rb b/ee/app/graphql/mutations/app_sec/fuzzing/api/ci_configuration/create.rb index bf0e04bf98892..45ee781b21f6f 100644 --- a/ee/app/graphql/mutations/app_sec/fuzzing/api/ci_configuration/create.rb +++ b/ee/app/graphql/mutations/app_sec/fuzzing/api/ci_configuration/create.rb @@ -6,10 +6,10 @@ module Fuzzing module API module CiConfiguration class Create < BaseMutation - include FindsProject - graphql_name 'ApiFuzzingCiConfigurationCreate' + include FindsProject + argument :project_path, GraphQL::Types::ID, required: true, description: 'Full path of the project.' diff --git a/ee/app/graphql/mutations/app_sec/fuzzing/coverage/corpus/create.rb b/ee/app/graphql/mutations/app_sec/fuzzing/coverage/corpus/create.rb index ad5c8229c6d7b..738ac343e3a9d 100644 --- a/ee/app/graphql/mutations/app_sec/fuzzing/coverage/corpus/create.rb +++ b/ee/app/graphql/mutations/app_sec/fuzzing/coverage/corpus/create.rb @@ -4,10 +4,10 @@ module Mutations module AppSec::Fuzzing::Coverage module Corpus class Create < BaseMutation - include FindsProject - graphql_name 'CorpusCreate' + include FindsProject + authorize :create_coverage_fuzzing_corpus argument :package_id, Types::GlobalIDType[::Packages::Package], diff --git a/ee/app/graphql/mutations/boards/epic_boards/create.rb b/ee/app/graphql/mutations/boards/epic_boards/create.rb index 8816e6ed3457e..e6fc0d6449672 100644 --- a/ee/app/graphql/mutations/boards/epic_boards/create.rb +++ b/ee/app/graphql/mutations/boards/epic_boards/create.rb @@ -4,12 +4,12 @@ module Mutations module Boards module EpicBoards class Create < ::Mutations::BaseMutation + graphql_name 'EpicBoardCreate' + include Mutations::ResolvesGroup include Mutations::Boards::CommonMutationArguments prepend Mutations::Boards::ScopedBoardMutation - graphql_name 'EpicBoardCreate' - authorize :admin_epic_board argument :group_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/boards/epic_boards/update.rb b/ee/app/graphql/mutations/boards/epic_boards/update.rb index 7ba3810b61700..6a7fe962ef16c 100644 --- a/ee/app/graphql/mutations/boards/epic_boards/update.rb +++ b/ee/app/graphql/mutations/boards/epic_boards/update.rb @@ -4,11 +4,11 @@ module Mutations module Boards module EpicBoards class Update < ::Mutations::BaseMutation + graphql_name 'EpicBoardUpdate' + include Mutations::Boards::CommonMutationArguments prepend Mutations::Boards::ScopedBoardMutation - graphql_name 'EpicBoardUpdate' - authorize :admin_epic_board argument :id, diff --git a/ee/app/graphql/mutations/boards/epics/create.rb b/ee/app/graphql/mutations/boards/epics/create.rb index f5b32026b6a35..90e214478a5b0 100644 --- a/ee/app/graphql/mutations/boards/epics/create.rb +++ b/ee/app/graphql/mutations/boards/epics/create.rb @@ -4,10 +4,10 @@ module Mutations module Boards module Epics class Create < ::Mutations::BaseMutation - include Mutations::ResolvesGroup - graphql_name 'BoardEpicCreate' + include Mutations::ResolvesGroup + argument :group_path, GraphQL::Types::ID, required: true, description: 'Group the epic to create is in.' diff --git a/ee/app/graphql/mutations/dast/profiles/create.rb b/ee/app/graphql/mutations/dast/profiles/create.rb index 33f5b72191927..2452d81b95360 100644 --- a/ee/app/graphql/mutations/dast/profiles/create.rb +++ b/ee/app/graphql/mutations/dast/profiles/create.rb @@ -4,10 +4,10 @@ module Mutations module Dast module Profiles class Create < BaseMutation - include FindsProject - graphql_name 'DastProfileCreate' + include FindsProject + field :dast_profile, ::Types::Dast::ProfileType, null: true, description: 'Created profile.' diff --git a/ee/app/graphql/mutations/dast/profiles/run.rb b/ee/app/graphql/mutations/dast/profiles/run.rb index b4f451eef1b33..fa034d77d3c5a 100644 --- a/ee/app/graphql/mutations/dast/profiles/run.rb +++ b/ee/app/graphql/mutations/dast/profiles/run.rb @@ -4,10 +4,10 @@ module Mutations module Dast module Profiles class Run < BaseMutation - include FindsProject - graphql_name 'DastProfileRun' + include FindsProject + ProfileID = ::Types::GlobalIDType[::Dast::Profile] field :pipeline_url, GraphQL::Types::String, diff --git a/ee/app/graphql/mutations/dast/profiles/update.rb b/ee/app/graphql/mutations/dast/profiles/update.rb index e22d8cc9e910a..628306f393490 100644 --- a/ee/app/graphql/mutations/dast/profiles/update.rb +++ b/ee/app/graphql/mutations/dast/profiles/update.rb @@ -4,10 +4,10 @@ module Mutations module Dast module Profiles class Update < BaseMutation - include FindsProject - graphql_name 'DastProfileUpdate' + include FindsProject + ProfileID = ::Types::GlobalIDType[::Dast::Profile] SiteProfileID = ::Types::GlobalIDType[::DastSiteProfile] ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile] diff --git a/ee/app/graphql/mutations/dast_on_demand_scans/create.rb b/ee/app/graphql/mutations/dast_on_demand_scans/create.rb index 73d891c284a91..c8bd57ae1c85b 100644 --- a/ee/app/graphql/mutations/dast_on_demand_scans/create.rb +++ b/ee/app/graphql/mutations/dast_on_demand_scans/create.rb @@ -3,12 +3,12 @@ module Mutations module DastOnDemandScans class Create < BaseMutation + graphql_name 'DastOnDemandScanCreate' + include FindsProject InvalidGlobalID = Class.new(StandardError) - graphql_name 'DastOnDemandScanCreate' - field :pipeline_url, GraphQL::Types::String, null: true, description: 'URL of the pipeline that was created.' diff --git a/ee/app/graphql/mutations/dast_scanner_profiles/create.rb b/ee/app/graphql/mutations/dast_scanner_profiles/create.rb index 283490cf0d96f..5d0b6370c1544 100644 --- a/ee/app/graphql/mutations/dast_scanner_profiles/create.rb +++ b/ee/app/graphql/mutations/dast_scanner_profiles/create.rb @@ -3,10 +3,10 @@ module Mutations module DastScannerProfiles class Create < BaseMutation - include FindsProject - graphql_name 'DastScannerProfileCreate' + include FindsProject + field :id, ::Types::GlobalIDType[::DastScannerProfile], null: true, description: 'ID of the scanner profile.' diff --git a/ee/app/graphql/mutations/dast_scanner_profiles/delete.rb b/ee/app/graphql/mutations/dast_scanner_profiles/delete.rb index ed7a2216e9a7c..2ebe851fa97c2 100644 --- a/ee/app/graphql/mutations/dast_scanner_profiles/delete.rb +++ b/ee/app/graphql/mutations/dast_scanner_profiles/delete.rb @@ -3,10 +3,10 @@ module Mutations module DastScannerProfiles class Delete < BaseMutation - include FindsProject - graphql_name 'DastScannerProfileDelete' + include FindsProject + ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile] argument :full_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/dast_scanner_profiles/update.rb b/ee/app/graphql/mutations/dast_scanner_profiles/update.rb index 0f6f73965ce6e..acaac68c576c1 100644 --- a/ee/app/graphql/mutations/dast_scanner_profiles/update.rb +++ b/ee/app/graphql/mutations/dast_scanner_profiles/update.rb @@ -3,10 +3,10 @@ module Mutations module DastScannerProfiles class Update < BaseMutation - include FindsProject - graphql_name 'DastScannerProfileUpdate' + include FindsProject + ScannerProfileID = ::Types::GlobalIDType[::DastScannerProfile] field :id, ScannerProfileID, diff --git a/ee/app/graphql/mutations/dast_site_profiles/create.rb b/ee/app/graphql/mutations/dast_site_profiles/create.rb index acbf82e0293f5..cfd45bb686f52 100644 --- a/ee/app/graphql/mutations/dast_site_profiles/create.rb +++ b/ee/app/graphql/mutations/dast_site_profiles/create.rb @@ -3,11 +3,11 @@ module Mutations module DastSiteProfiles class Create < BaseMutation + graphql_name 'DastSiteProfileCreate' + include FindsProject include Mutations::AppSec::Dast::SiteProfiles::SharedArguments - graphql_name 'DastSiteProfileCreate' - field :id, SiteProfileID, null: true, description: 'ID of the site profile.' diff --git a/ee/app/graphql/mutations/dast_site_profiles/update.rb b/ee/app/graphql/mutations/dast_site_profiles/update.rb index 4b0524b0059b5..07b9e8c8b20d9 100644 --- a/ee/app/graphql/mutations/dast_site_profiles/update.rb +++ b/ee/app/graphql/mutations/dast_site_profiles/update.rb @@ -3,11 +3,11 @@ module Mutations module DastSiteProfiles class Update < BaseMutation + graphql_name 'DastSiteProfileUpdate' + include FindsProject include Mutations::AppSec::Dast::SiteProfiles::SharedArguments - graphql_name 'DastSiteProfileUpdate' - field :id, SiteProfileID, null: true, description: 'ID of the site profile.' diff --git a/ee/app/graphql/mutations/dast_site_tokens/create.rb b/ee/app/graphql/mutations/dast_site_tokens/create.rb index a3d8f1287dd69..ff7435157546a 100644 --- a/ee/app/graphql/mutations/dast_site_tokens/create.rb +++ b/ee/app/graphql/mutations/dast_site_tokens/create.rb @@ -3,10 +3,10 @@ module Mutations module DastSiteTokens class Create < BaseMutation - include FindsProject - graphql_name 'DastSiteTokenCreate' + include FindsProject + field :id, ::Types::GlobalIDType[::DastSiteToken], null: true, description: 'ID of the site token.' diff --git a/ee/app/graphql/mutations/dast_site_validations/create.rb b/ee/app/graphql/mutations/dast_site_validations/create.rb index fdbed3a7689e9..b9ef8b5917b13 100644 --- a/ee/app/graphql/mutations/dast_site_validations/create.rb +++ b/ee/app/graphql/mutations/dast_site_validations/create.rb @@ -3,10 +3,10 @@ module Mutations module DastSiteValidations class Create < BaseMutation - include FindsProject - graphql_name 'DastSiteValidationCreate' + include FindsProject + field :id, ::Types::GlobalIDType[::DastSiteValidation], null: true, description: 'ID of the site validation.' diff --git a/ee/app/graphql/mutations/dast_site_validations/revoke.rb b/ee/app/graphql/mutations/dast_site_validations/revoke.rb index cc2ff732d88f1..330d6764ebcc7 100644 --- a/ee/app/graphql/mutations/dast_site_validations/revoke.rb +++ b/ee/app/graphql/mutations/dast_site_validations/revoke.rb @@ -3,10 +3,10 @@ module Mutations module DastSiteValidations class Revoke < BaseMutation - include FindsProject - graphql_name 'DastSiteValidationRevoke' + include FindsProject + argument :full_path, GraphQL::Types::ID, required: true, description: 'Project the site validation belongs to.' diff --git a/ee/app/graphql/mutations/epics/add_issue.rb b/ee/app/graphql/mutations/epics/add_issue.rb index 4e11a7549b117..9e48523f2e8b9 100644 --- a/ee/app/graphql/mutations/epics/add_issue.rb +++ b/ee/app/graphql/mutations/epics/add_issue.rb @@ -3,10 +3,10 @@ module Mutations module Epics class AddIssue < Base - include Mutations::ResolvesIssuable - graphql_name 'EpicAddIssue' + include Mutations::ResolvesIssuable + authorize :admin_epic argument :project_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/epics/create.rb b/ee/app/graphql/mutations/epics/create.rb index ce86a568dbfa4..22e5216a803d2 100644 --- a/ee/app/graphql/mutations/epics/create.rb +++ b/ee/app/graphql/mutations/epics/create.rb @@ -3,11 +3,11 @@ module Mutations module Epics class Create < BaseMutation + graphql_name 'CreateEpic' + include Mutations::ResolvesGroup prepend Mutations::SharedEpicArguments - graphql_name 'CreateEpic' - authorize :create_epic field :epic, diff --git a/ee/app/graphql/mutations/epics/update.rb b/ee/app/graphql/mutations/epics/update.rb index feb56ec092c40..10344ba786ec2 100644 --- a/ee/app/graphql/mutations/epics/update.rb +++ b/ee/app/graphql/mutations/epics/update.rb @@ -3,10 +3,10 @@ module Mutations module Epics class Update < Base - prepend Mutations::SharedEpicArguments - graphql_name 'UpdateEpic' + prepend Mutations::SharedEpicArguments + argument :state_event, Types::EpicStateEventEnum, required: false, diff --git a/ee/app/graphql/mutations/incident_management/escalation_policy/create.rb b/ee/app/graphql/mutations/incident_management/escalation_policy/create.rb index 4437b3e51baad..53f808fd144e9 100644 --- a/ee/app/graphql/mutations/incident_management/escalation_policy/create.rb +++ b/ee/app/graphql/mutations/incident_management/escalation_policy/create.rb @@ -4,10 +4,10 @@ module Mutations module IncidentManagement module EscalationPolicy class Create < Base - include ResolvesProject - graphql_name 'EscalationPolicyCreate' + include ResolvesProject + argument :project_path, GraphQL::Types::ID, required: true, description: 'Project to create the escalation policy for.' diff --git a/ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb b/ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb index 0abb4fa51deaa..cb69f9fa9d560 100644 --- a/ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb +++ b/ee/app/graphql/mutations/incident_management/oncall_rotation/create.rb @@ -4,10 +4,10 @@ module Mutations module IncidentManagement module OncallRotation class Create < Base - include ResolvesProject - graphql_name 'OncallRotationCreate' + include ResolvesProject + argument :project_path, GraphQL::Types::ID, required: true, description: 'Project to create the on-call schedule in.' diff --git a/ee/app/graphql/mutations/incident_management/oncall_rotation/update.rb b/ee/app/graphql/mutations/incident_management/oncall_rotation/update.rb index 7c2a9155f152e..bf71230c940d1 100644 --- a/ee/app/graphql/mutations/incident_management/oncall_rotation/update.rb +++ b/ee/app/graphql/mutations/incident_management/oncall_rotation/update.rb @@ -4,10 +4,10 @@ module Mutations module IncidentManagement module OncallRotation class Update < Base - include ResolvesProject - graphql_name 'OncallRotationUpdate' + include ResolvesProject + argument :id, ::Types::GlobalIDType[::IncidentManagement::OncallRotation], required: true, description: 'ID of the on-call schedule to create the on-call rotation in.' diff --git a/ee/app/graphql/mutations/incident_management/oncall_schedule/create.rb b/ee/app/graphql/mutations/incident_management/oncall_schedule/create.rb index bc676f645d786..fcac9c0b2c71d 100644 --- a/ee/app/graphql/mutations/incident_management/oncall_schedule/create.rb +++ b/ee/app/graphql/mutations/incident_management/oncall_schedule/create.rb @@ -4,10 +4,10 @@ module Mutations module IncidentManagement module OncallSchedule class Create < OncallScheduleBase - include FindsProject - graphql_name 'OncallScheduleCreate' + include FindsProject + argument :project_path, GraphQL::Types::ID, required: true, description: 'Project to create the on-call schedule in.' diff --git a/ee/app/graphql/mutations/issues/promote_to_epic.rb b/ee/app/graphql/mutations/issues/promote_to_epic.rb index 90ee6652d587a..e012016f599a0 100644 --- a/ee/app/graphql/mutations/issues/promote_to_epic.rb +++ b/ee/app/graphql/mutations/issues/promote_to_epic.rb @@ -3,10 +3,10 @@ module Mutations module Issues class PromoteToEpic < Base - include Mutations::ResolvesGroup - graphql_name 'PromoteToEpic' + include Mutations::ResolvesGroup + argument :group_path, GraphQL::Types::ID, required: false, description: 'Group the promoted epic will belong to.' diff --git a/ee/app/graphql/mutations/iterations/cadences/create.rb b/ee/app/graphql/mutations/iterations/cadences/create.rb index e548414ef2196..dcb92e4415100 100644 --- a/ee/app/graphql/mutations/iterations/cadences/create.rb +++ b/ee/app/graphql/mutations/iterations/cadences/create.rb @@ -4,10 +4,10 @@ module Mutations module Iterations module Cadences class Create < BaseMutation - include Mutations::ResolvesGroup - graphql_name 'IterationCadenceCreate' + include Mutations::ResolvesGroup + authorize :create_iteration_cadence argument :group_path, GraphQL::Types::ID, required: true, diff --git a/ee/app/graphql/mutations/iterations/create.rb b/ee/app/graphql/mutations/iterations/create.rb index 0bbcfa4d19a5f..ad888570211ce 100644 --- a/ee/app/graphql/mutations/iterations/create.rb +++ b/ee/app/graphql/mutations/iterations/create.rb @@ -3,10 +3,10 @@ module Mutations module Iterations class Create < BaseMutation - include Mutations::ResolvesResourceParent - graphql_name 'iterationCreate' + include Mutations::ResolvesResourceParent + authorize :create_iteration field :iteration, diff --git a/ee/app/graphql/mutations/iterations/update.rb b/ee/app/graphql/mutations/iterations/update.rb index 0be37caf78338..fefa837eb26d5 100644 --- a/ee/app/graphql/mutations/iterations/update.rb +++ b/ee/app/graphql/mutations/iterations/update.rb @@ -3,11 +3,11 @@ module Mutations module Iterations class Update < BaseMutation + graphql_name 'UpdateIteration' + include Mutations::ResolvesGroup include ResolvesProject - graphql_name 'UpdateIteration' - authorize :admin_iteration field :iteration, diff --git a/ee/app/graphql/mutations/projects/set_locked.rb b/ee/app/graphql/mutations/projects/set_locked.rb index ee509f3060acb..4c20d51aa5691 100644 --- a/ee/app/graphql/mutations/projects/set_locked.rb +++ b/ee/app/graphql/mutations/projects/set_locked.rb @@ -3,10 +3,10 @@ module Mutations module Projects class SetLocked < BaseMutation - include FindsProject - graphql_name 'ProjectSetLocked' + include FindsProject + authorize :push_code argument :project_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/quality_management/test_cases/create.rb b/ee/app/graphql/mutations/quality_management/test_cases/create.rb index 10abfab1a7278..ab58ff6cd476d 100644 --- a/ee/app/graphql/mutations/quality_management/test_cases/create.rb +++ b/ee/app/graphql/mutations/quality_management/test_cases/create.rb @@ -4,10 +4,10 @@ module Mutations module QualityManagement module TestCases class Create < BaseMutation - include FindsProject - graphql_name 'CreateTestCase' + include FindsProject + authorize :create_test_case argument :title, GraphQL::Types::String, diff --git a/ee/app/graphql/mutations/requirements_management/create_requirement.rb b/ee/app/graphql/mutations/requirements_management/create_requirement.rb index a81c3d9d18296..d954f14efaf00 100644 --- a/ee/app/graphql/mutations/requirements_management/create_requirement.rb +++ b/ee/app/graphql/mutations/requirements_management/create_requirement.rb @@ -3,10 +3,10 @@ module Mutations module RequirementsManagement class CreateRequirement < BaseRequirement - include FindsProject - graphql_name 'CreateRequirement' + include FindsProject + authorize :create_requirement def resolve(args) diff --git a/ee/app/graphql/mutations/requirements_management/export_requirements.rb b/ee/app/graphql/mutations/requirements_management/export_requirements.rb index 9af91dad8760a..780c93df49b18 100644 --- a/ee/app/graphql/mutations/requirements_management/export_requirements.rb +++ b/ee/app/graphql/mutations/requirements_management/export_requirements.rb @@ -3,11 +3,11 @@ module Mutations module RequirementsManagement class ExportRequirements < BaseMutation + graphql_name 'ExportRequirements' + include FindsProject include CommonRequirementArguments - graphql_name 'ExportRequirements' - authorize :export_requirements argument :project_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/security/training_provider_update.rb b/ee/app/graphql/mutations/security/training_provider_update.rb index a8bc8a5a6be95..3f235503e088a 100644 --- a/ee/app/graphql/mutations/security/training_provider_update.rb +++ b/ee/app/graphql/mutations/security/training_provider_update.rb @@ -3,10 +3,10 @@ module Mutations module Security class TrainingProviderUpdate < BaseMutation - include FindsProject - graphql_name 'SecurityTrainingUpdate' + include FindsProject + authorize :access_security_and_compliance argument :project_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/security_policy/assign_security_policy_project.rb b/ee/app/graphql/mutations/security_policy/assign_security_policy_project.rb index b403ccac99e67..c0f0c4c5c0c05 100644 --- a/ee/app/graphql/mutations/security_policy/assign_security_policy_project.rb +++ b/ee/app/graphql/mutations/security_policy/assign_security_policy_project.rb @@ -3,14 +3,13 @@ module Mutations module SecurityPolicy class AssignSecurityPolicyProject < BaseMutation - include FindsProject - graphql_name 'SecurityPolicyProjectAssign' - description 'Assigns the specified project(`security_policy_project_id`) as security policy project '\ 'for the given project(`project_path`). If the project already has a security policy project, '\ 'this reassigns the project\'s security policy project with the given `security_policy_project_id`' + include FindsProject + authorize :update_security_orchestration_policy_project argument :project_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/security_policy/commit_scan_execution_policy.rb b/ee/app/graphql/mutations/security_policy/commit_scan_execution_policy.rb index 469673bc1af64..a7fe1ceb4d0c9 100644 --- a/ee/app/graphql/mutations/security_policy/commit_scan_execution_policy.rb +++ b/ee/app/graphql/mutations/security_policy/commit_scan_execution_policy.rb @@ -3,12 +3,11 @@ module Mutations module SecurityPolicy class CommitScanExecutionPolicy < BaseMutation - include FindsProject - graphql_name 'ScanExecutionPolicyCommit' - description 'Commits the `policy_yaml` content to the assigned security policy project for the given project(`project_path`)' + include FindsProject + authorize :security_orchestration_policies argument :project_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/security_policy/create_security_policy_project.rb b/ee/app/graphql/mutations/security_policy/create_security_policy_project.rb index 7fa7e4ee5ca47..273479afd7df7 100644 --- a/ee/app/graphql/mutations/security_policy/create_security_policy_project.rb +++ b/ee/app/graphql/mutations/security_policy/create_security_policy_project.rb @@ -3,12 +3,11 @@ module Mutations module SecurityPolicy class CreateSecurityPolicyProject < BaseMutation - include FindsProject - graphql_name 'SecurityPolicyProjectCreate' - description 'Creates and assigns a security policy project for the given project(`project_path`)' + include FindsProject + authorize :update_security_orchestration_policy_project argument :project_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/mutations/security_policy/unassign_security_policy_project.rb b/ee/app/graphql/mutations/security_policy/unassign_security_policy_project.rb index 663bbceeade8e..33d826424865a 100644 --- a/ee/app/graphql/mutations/security_policy/unassign_security_policy_project.rb +++ b/ee/app/graphql/mutations/security_policy/unassign_security_policy_project.rb @@ -3,12 +3,11 @@ module Mutations module SecurityPolicy class UnassignSecurityPolicyProject < BaseMutation - include FindsProject - graphql_name 'SecurityPolicyProjectUnassign' - description 'Unassigns the security policy project for the given project(`project_path`).' + include FindsProject + authorize :update_security_orchestration_policy_project argument :project_path, GraphQL::Types::ID, diff --git a/ee/app/graphql/types/admin/cloud_licenses/current_license_type.rb b/ee/app/graphql/types/admin/cloud_licenses/current_license_type.rb index 15135c19fe179..e26fd04db8c07 100644 --- a/ee/app/graphql/types/admin/cloud_licenses/current_license_type.rb +++ b/ee/app/graphql/types/admin/cloud_licenses/current_license_type.rb @@ -5,11 +5,11 @@ module Admin module CloudLicenses # rubocop: disable Graphql/AuthorizeTypes class CurrentLicenseType < BaseObject - include ::Types::Admin::CloudLicenses::LicenseType - graphql_name 'CurrentLicense' description 'Represents the current license' + include ::Types::Admin::CloudLicenses::LicenseType + field :last_sync, ::Types::TimeType, null: true, description: 'Date when the license was last synced.', method: :last_synced_at diff --git a/ee/app/graphql/types/admin/cloud_licenses/license_history_entry_type.rb b/ee/app/graphql/types/admin/cloud_licenses/license_history_entry_type.rb index 85e50de344ab3..2f14e0eea97f0 100644 --- a/ee/app/graphql/types/admin/cloud_licenses/license_history_entry_type.rb +++ b/ee/app/graphql/types/admin/cloud_licenses/license_history_entry_type.rb @@ -5,10 +5,10 @@ module Admin module CloudLicenses # rubocop: disable Graphql/AuthorizeTypes class LicenseHistoryEntryType < BaseObject - include ::Types::Admin::CloudLicenses::LicenseType - graphql_name 'LicenseHistoryEntry' description 'Represents an entry from the Cloud License history' + + include ::Types::Admin::CloudLicenses::LicenseType end end end diff --git a/ee/app/graphql/types/admin/cloud_licenses/subscription_future_entry_type.rb b/ee/app/graphql/types/admin/cloud_licenses/subscription_future_entry_type.rb index d37cd881bab43..33a4f046bd20d 100644 --- a/ee/app/graphql/types/admin/cloud_licenses/subscription_future_entry_type.rb +++ b/ee/app/graphql/types/admin/cloud_licenses/subscription_future_entry_type.rb @@ -5,6 +5,9 @@ module Admin module CloudLicenses # rubocop: disable Graphql/AuthorizeTypes class SubscriptionFutureEntryType < BaseObject + graphql_name 'SubscriptionFutureEntry' + description 'Represents an entry from the future subscriptions' + field :type, GraphQL::Types::String, null: false, description: 'Type of license the subscription will yield.' @@ -28,9 +31,6 @@ class SubscriptionFutureEntryType < BaseObject field :users_in_license_count, GraphQL::Types::Int, null: true, description: 'Number of paid user seats.' - - graphql_name 'SubscriptionFutureEntry' - description 'Represents an entry from the future subscriptions' end end end diff --git a/ee/app/graphql/types/boards/epic_list_type.rb b/ee/app/graphql/types/boards/epic_list_type.rb index 5f2706f688955..17ef450c03942 100644 --- a/ee/app/graphql/types/boards/epic_list_type.rb +++ b/ee/app/graphql/types/boards/epic_list_type.rb @@ -4,11 +4,11 @@ module Types module Boards # rubocop: disable Graphql/AuthorizeTypes class EpicListType < BaseObject - include Gitlab::Utils::StrongMemoize - graphql_name 'EpicList' description 'Represents an epic board list' + include Gitlab::Utils::StrongMemoize + accepts ::Boards::EpicList alias_method :list, :object diff --git a/ee/app/graphql/types/dast_site_profile_type.rb b/ee/app/graphql/types/dast_site_profile_type.rb index 665f1a40d6c37..5a148b294e82c 100644 --- a/ee/app/graphql/types/dast_site_profile_type.rb +++ b/ee/app/graphql/types/dast_site_profile_type.rb @@ -2,11 +2,11 @@ module Types class DastSiteProfileType < BaseObject - REDACTED_REQUEST_HEADERS = '[Redacted]' - graphql_name 'DastSiteProfile' description 'Represents a DAST Site Profile' + REDACTED_REQUEST_HEADERS = '[Redacted]' + present_using ::Dast::SiteProfilePresenter authorize :read_on_demand_dast_scan diff --git a/ee/app/graphql/types/epic_type.rb b/ee/app/graphql/types/epic_type.rb index 4384aadb95c03..2f7bdf8990db0 100644 --- a/ee/app/graphql/types/epic_type.rb +++ b/ee/app/graphql/types/epic_type.rb @@ -2,10 +2,11 @@ module Types class EpicType < BaseObject - include ::Gitlab::Graphql::Aggregations::Epics::Constants - graphql_name 'Epic' description 'Represents an epic' + + include ::Gitlab::Graphql::Aggregations::Epics::Constants + accepts ::Epic authorize :read_epic diff --git a/ee/app/graphql/types/geo/group_wiki_repository_registry_type.rb b/ee/app/graphql/types/geo/group_wiki_repository_registry_type.rb index c8abb04c4ca4d..f96a7b3bd38bb 100644 --- a/ee/app/graphql/types/geo/group_wiki_repository_registry_type.rb +++ b/ee/app/graphql/types/geo/group_wiki_repository_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class GroupWikiRepositoryRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'GroupWikiRepositoryRegistry' description 'Represents the Geo sync and verification state of a group wiki repository' + include ::Types::Geo::RegistryType + field :group_wiki_repository_id, GraphQL::Types::ID, null: false, description: 'ID of the Group Wiki Repository.' end end diff --git a/ee/app/graphql/types/geo/lfs_object_registry_type.rb b/ee/app/graphql/types/geo/lfs_object_registry_type.rb index 623f9fbc0a52a..9dad2f2e4a050 100644 --- a/ee/app/graphql/types/geo/lfs_object_registry_type.rb +++ b/ee/app/graphql/types/geo/lfs_object_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class LfsObjectRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'LfsObjectRegistry' description 'Represents the Geo sync and verification state of an LFS object' + include ::Types::Geo::RegistryType + field :lfs_object_id, GraphQL::Types::ID, null: false, description: 'ID of the LFS object.' end end diff --git a/ee/app/graphql/types/geo/merge_request_diff_registry_type.rb b/ee/app/graphql/types/geo/merge_request_diff_registry_type.rb index 45a487a88f8bd..73c1af762150f 100644 --- a/ee/app/graphql/types/geo/merge_request_diff_registry_type.rb +++ b/ee/app/graphql/types/geo/merge_request_diff_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class MergeRequestDiffRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'MergeRequestDiffRegistry' description 'Represents the Geo sync and verification state of a Merge Request diff' + include ::Types::Geo::RegistryType + field :merge_request_diff_id, GraphQL::Types::ID, null: false, description: 'ID of the Merge Request diff.' end end diff --git a/ee/app/graphql/types/geo/package_file_registry_type.rb b/ee/app/graphql/types/geo/package_file_registry_type.rb index d49a0002bd9b3..351d31f3a9aa5 100644 --- a/ee/app/graphql/types/geo/package_file_registry_type.rb +++ b/ee/app/graphql/types/geo/package_file_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class PackageFileRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'PackageFileRegistry' description 'Represents the Geo sync and verification state of a package file' + include ::Types::Geo::RegistryType + field :package_file_id, GraphQL::Types::ID, null: false, description: 'ID of the PackageFile.' end end diff --git a/ee/app/graphql/types/geo/pages_deployment_registry_type.rb b/ee/app/graphql/types/geo/pages_deployment_registry_type.rb index 69a971fceebb8..9723b498d37a2 100644 --- a/ee/app/graphql/types/geo/pages_deployment_registry_type.rb +++ b/ee/app/graphql/types/geo/pages_deployment_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class PagesDeploymentRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'PagesDeploymentRegistry' description 'Represents the Geo replication and verification state of a pages_deployment' + include ::Types::Geo::RegistryType + field :pages_deployment_id, GraphQL::Types::ID, null: false, description: 'ID of the Pages Deployment.' end end diff --git a/ee/app/graphql/types/geo/pipeline_artifact_registry_type.rb b/ee/app/graphql/types/geo/pipeline_artifact_registry_type.rb index 3e25b872b5849..d7dcd2f9c3429 100644 --- a/ee/app/graphql/types/geo/pipeline_artifact_registry_type.rb +++ b/ee/app/graphql/types/geo/pipeline_artifact_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class PipelineArtifactRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'PipelineArtifactRegistry' description 'Represents the Geo sync and verification state of a pipeline artifact' + include ::Types::Geo::RegistryType + field :pipeline_artifact_id, GraphQL::Types::ID, null: false, description: 'ID of the pipeline artifact.' end end diff --git a/ee/app/graphql/types/geo/snippet_repository_registry_type.rb b/ee/app/graphql/types/geo/snippet_repository_registry_type.rb index 37cc440c0e13c..f7a5aa88c8b82 100644 --- a/ee/app/graphql/types/geo/snippet_repository_registry_type.rb +++ b/ee/app/graphql/types/geo/snippet_repository_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class SnippetRepositoryRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'SnippetRepositoryRegistry' description 'Represents the Geo sync and verification state of a snippet repository' + include ::Types::Geo::RegistryType + field :snippet_repository_id, GraphQL::Types::ID, null: false, description: 'ID of the Snippet Repository.' end end diff --git a/ee/app/graphql/types/geo/terraform_state_version_registry_type.rb b/ee/app/graphql/types/geo/terraform_state_version_registry_type.rb index f8ef40f81ab37..a3b68d1e94693 100644 --- a/ee/app/graphql/types/geo/terraform_state_version_registry_type.rb +++ b/ee/app/graphql/types/geo/terraform_state_version_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class TerraformStateVersionRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'TerraformStateVersionRegistry' description 'Represents the Geo sync and verification state of a terraform state version' + include ::Types::Geo::RegistryType + field :terraform_state_version_id, GraphQL::Types::ID, null: false, description: 'ID of the terraform state version.' end end diff --git a/ee/app/graphql/types/geo/upload_registry_type.rb b/ee/app/graphql/types/geo/upload_registry_type.rb index a1eae8ae09198..9467e2880084e 100644 --- a/ee/app/graphql/types/geo/upload_registry_type.rb +++ b/ee/app/graphql/types/geo/upload_registry_type.rb @@ -4,11 +4,11 @@ module Types module Geo # rubocop:disable Graphql/AuthorizeTypes because it is included class UploadRegistryType < BaseObject - include ::Types::Geo::RegistryType - graphql_name 'UploadRegistry' description 'Represents the Geo replication and verification state of an upload.' + include ::Types::Geo::RegistryType + field :file_id, GraphQL::Types::ID, null: false, description: 'ID of the Upload.' end end diff --git a/ee/app/graphql/types/incident_management/oncall_rotation_type.rb b/ee/app/graphql/types/incident_management/oncall_rotation_type.rb index 4c425aae781df..39c5bc6c79684 100644 --- a/ee/app/graphql/types/incident_management/oncall_rotation_type.rb +++ b/ee/app/graphql/types/incident_management/oncall_rotation_type.rb @@ -3,11 +3,11 @@ module Types module IncidentManagement class OncallRotationType < BaseObject - MAX_SHIFTS_FOR_TIMEFRAME = 350 - graphql_name 'IncidentManagementOncallRotation' description 'Describes an incident management on-call rotation' + MAX_SHIFTS_FOR_TIMEFRAME = 350 + authorize :read_incident_management_oncall_schedule field :id, diff --git a/ee/app/graphql/types/scan_type.rb b/ee/app/graphql/types/scan_type.rb index 5b132ec6748a5..3aaba713f7c97 100644 --- a/ee/app/graphql/types/scan_type.rb +++ b/ee/app/graphql/types/scan_type.rb @@ -3,11 +3,11 @@ module Types # rubocop: disable Graphql/AuthorizeTypes class ScanType < BaseObject - present_using ::Security::ScanPresenter - graphql_name 'Scan' description 'Represents the security scan information' + present_using ::Security::ScanPresenter + authorize :read_scan field :name, GraphQL::Types::String, null: false, description: 'Name of the scan.' diff --git a/ee/app/graphql/types/vulnerability_detail_type.rb b/ee/app/graphql/types/vulnerability_detail_type.rb index 01d4a150768b8..dffb5b3c7cdf9 100644 --- a/ee/app/graphql/types/vulnerability_detail_type.rb +++ b/ee/app/graphql/types/vulnerability_detail_type.rb @@ -2,10 +2,10 @@ module Types class VulnerabilityDetailType < BaseUnion - UnexpectedReportType = Class.new(StandardError) + graphql_name 'VulnerabilityDetail' description 'Represents a vulnerability detail field. The fields with data will depend on the vulnerability detail type' - graphql_name 'VulnerabilityDetail' + UnexpectedReportType = Class.new(StandardError) possible_types VulnerabilityDetails::UrlType, VulnerabilityDetails::IntType, diff --git a/ee/app/graphql/types/vulnerability_location_type.rb b/ee/app/graphql/types/vulnerability_location_type.rb index 153461e7d0785..9392c9d930e72 100644 --- a/ee/app/graphql/types/vulnerability_location_type.rb +++ b/ee/app/graphql/types/vulnerability_location_type.rb @@ -2,11 +2,11 @@ module Types class VulnerabilityLocationType < BaseUnion - UnexpectedReportType = Class.new(StandardError) - graphql_name 'VulnerabilityLocation' description 'Represents a vulnerability location. The fields with data will depend on the vulnerability report type' + UnexpectedReportType = Class.new(StandardError) + possible_types VulnerabilityLocation::ClusterImageScanningType, VulnerabilityLocation::ContainerScanningType, VulnerabilityLocation::DependencyScanningType, -- GitLab