Commit 44276368 authored by Michael Kozono's avatar Michael Kozono

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

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

See merge request gitlab-org/gitlab!66566
parents 7bd83c1b d9ff681b
......@@ -180,74 +180,6 @@ Graphql/OldTypes:
- 'ee/app/graphql/types/dast_site_profile_type.rb'
- 'ee/app/graphql/types/dast_site_validation_type.rb'
- 'ee/app/graphql/types/dora_metric_type.rb'
- 'ee/app/graphql/types/epic_descendant_count_type.rb'
- 'ee/app/graphql/types/epic_descendant_weight_sum_type.rb'
- 'ee/app/graphql/types/epic_health_status_type.rb'
- 'ee/app/graphql/types/epic_issue_type.rb'
- 'ee/app/graphql/types/epic_type.rb'
- 'ee/app/graphql/types/epics/negated_epic_filter_input_type.rb'
- 'ee/app/graphql/types/external_issue_type.rb'
- 'ee/app/graphql/types/geo/geo_node_type.rb'
- 'ee/app/graphql/types/geo/group_wiki_repository_registry_type.rb'
- 'ee/app/graphql/types/geo/lfs_object_registry_type.rb'
- 'ee/app/graphql/types/geo/merge_request_diff_registry_type.rb'
- 'ee/app/graphql/types/geo/package_file_registry_type.rb'
- 'ee/app/graphql/types/geo/pipeline_artifact_registry_type.rb'
- 'ee/app/graphql/types/geo/registry_type.rb'
- 'ee/app/graphql/types/geo/snippet_repository_registry_type.rb'
- 'ee/app/graphql/types/geo/terraform_state_version_registry_type.rb'
- 'ee/app/graphql/types/group_release_stats_type.rb'
- 'ee/app/graphql/types/incident_management/escalation_policy_type.rb'
- 'ee/app/graphql/types/incident_management/escalation_rule_input_type.rb'
- 'ee/app/graphql/types/incident_management/escalation_rule_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_participant_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_rotation_active_period_input_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_rotation_active_period_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_rotation_date_input_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_rotation_length_input_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_rotation_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_schedule_type.rb'
- 'ee/app/graphql/types/incident_management/oncall_user_input_type.rb'
- 'ee/app/graphql/types/iteration_type.rb'
- 'ee/app/graphql/types/iterations/cadence_type.rb'
- 'ee/app/graphql/types/kas/agent_configuration_type.rb'
- 'ee/app/graphql/types/metric_image_type.rb'
- 'ee/app/graphql/types/network_policy_type.rb'
- 'ee/app/graphql/types/path_lock_type.rb'
- 'ee/app/graphql/types/push_rules_type.rb'
- 'ee/app/graphql/types/requirements_management/requirement_states_count_type.rb'
- 'ee/app/graphql/types/requirements_management/requirement_type.rb'
- 'ee/app/graphql/types/requirements_management/test_report_type.rb'
- 'ee/app/graphql/types/scan_execution_policy_type.rb'
- 'ee/app/graphql/types/scan_type.rb'
- 'ee/app/graphql/types/scanned_resource_type.rb'
- 'ee/app/graphql/types/security_report_summary_section_type.rb'
- 'ee/app/graphql/types/timebox_metrics_type.rb'
- 'ee/app/graphql/types/vulnerabilities_count_by_day_type.rb'
- 'ee/app/graphql/types/vulnerability/issue_link_type.rb'
- 'ee/app/graphql/types/vulnerability_details/base_type.rb'
- 'ee/app/graphql/types/vulnerability_details/boolean_type.rb'
- 'ee/app/graphql/types/vulnerability_details/code_type.rb'
- 'ee/app/graphql/types/vulnerability_details/commit_type.rb'
- 'ee/app/graphql/types/vulnerability_details/diff_type.rb'
- 'ee/app/graphql/types/vulnerability_details/file_location_type.rb'
- 'ee/app/graphql/types/vulnerability_details/int_type.rb'
- 'ee/app/graphql/types/vulnerability_details/markdown_type.rb'
- 'ee/app/graphql/types/vulnerability_details/module_location_type.rb'
- 'ee/app/graphql/types/vulnerability_details/text_type.rb'
- 'ee/app/graphql/types/vulnerability_details/url_type.rb'
- 'ee/app/graphql/types/vulnerability_identifier_type.rb'
- 'ee/app/graphql/types/vulnerability_location/container_scanning_type.rb'
- 'ee/app/graphql/types/vulnerability_location/coverage_fuzzing_type.rb'
- 'ee/app/graphql/types/vulnerability_location/dast_type.rb'
- 'ee/app/graphql/types/vulnerability_location/dependency_scanning_type.rb'
- 'ee/app/graphql/types/vulnerability_location/sast_type.rb'
- 'ee/app/graphql/types/vulnerability_location/secret_detection_type.rb'
- 'ee/app/graphql/types/vulnerability_scanner_type.rb'
- 'ee/app/graphql/types/vulnerability_type.rb'
- 'ee/app/graphql/types/vulnerable_dependency_type.rb'
- 'ee/app/graphql/types/vulnerable_package_type.rb'
- 'ee/app/graphql/types/vulnerable_projects_by_grade_type.rb'
# WIP: See https://gitlab.com/gitlab-org/gitlab/-/issues/220040
Rails/SaveBang:
......
......@@ -6,10 +6,10 @@ module Types
graphql_name 'EpicDescendantCount'
description 'Counts of descendent epics'
field :opened_epics, GraphQL::INT_TYPE, null: true, description: 'Number of opened child epics.'
field :closed_epics, GraphQL::INT_TYPE, null: true, description: 'Number of closed child epics.'
field :opened_issues, GraphQL::INT_TYPE, null: true, description: 'Number of opened epic issues.'
field :closed_issues, GraphQL::INT_TYPE, null: true, description: 'Number of closed epic issues.'
field :opened_epics, GraphQL::Types::Int, null: true, description: 'Number of opened child epics.'
field :closed_epics, GraphQL::Types::Int, null: true, description: 'Number of closed child epics.'
field :opened_issues, GraphQL::Types::Int, null: true, description: 'Number of opened epic issues.'
field :closed_issues, GraphQL::Types::Int, null: true, description: 'Number of closed epic issues.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......@@ -6,9 +6,9 @@ module Types
graphql_name 'EpicDescendantWeights'
description 'Total weight of open and closed descendant issues'
field :opened_issues, GraphQL::INT_TYPE, null: true,
field :opened_issues, GraphQL::Types::Int, null: true,
description: 'Total weight of opened issues in this epic, including epic descendants.'
field :closed_issues, GraphQL::INT_TYPE, null: true,
field :closed_issues, GraphQL::Types::Int, null: true,
description: 'Total weight of completed (closed) issues in this epic, including epic descendants.'
end
# rubocop: enable Graphql/AuthorizeTypes
......
......@@ -6,9 +6,9 @@ module Types
graphql_name 'EpicHealthStatus'
description 'Health status of child issues'
field :issues_on_track, GraphQL::INT_TYPE, null: true, description: 'Number of issues on track.'
field :issues_needing_attention, GraphQL::INT_TYPE, null: true, description: 'Number of issues that need attention.'
field :issues_at_risk, GraphQL::INT_TYPE, null: true, description: 'Number of issues at risk.'
field :issues_on_track, GraphQL::Types::Int, null: true, description: 'Number of issues on track.'
field :issues_needing_attention, GraphQL::Types::Int, null: true, description: 'Number of issues that need attention.'
field :issues_at_risk, GraphQL::Types::Int, null: true, description: 'Number of issues at risk.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......@@ -9,13 +9,13 @@ module Types
present_using EpicIssuePresenter
field :epic_issue_id, GraphQL::ID_TYPE, null: false,
field :epic_issue_id, GraphQL::Types::ID, null: false,
description: 'ID of the epic-issue relation.'
field :relation_path, GraphQL::STRING_TYPE, null: true,
field :relation_path, GraphQL::Types::String, null: true,
description: 'URI path of the epic-issue relation.'
field :id, GraphQL::ID_TYPE, null: true,
field :id, GraphQL::Types::ID, null: true,
description: 'Global ID of the epic-issue relation.'
def epic_issue_id
......
......@@ -17,19 +17,19 @@ module Types
implements(Types::CurrentUserTodos)
implements(Types::EventableType)
field :id, GraphQL::ID_TYPE, null: false,
field :id, GraphQL::Types::ID, null: false,
description: 'ID of the epic.'
field :iid, GraphQL::ID_TYPE, null: false,
field :iid, GraphQL::Types::ID, null: false,
description: 'Internal ID of the epic.'
field :title, GraphQL::STRING_TYPE, null: true,
field :title, GraphQL::Types::String, null: true,
description: 'Title of the epic.'
markdown_field :title_html, null: true
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
description: 'Description of the epic.'
markdown_field :description_html, null: true
field :state, EpicStateEnum, null: false,
description: 'State of the epic.'
field :confidential, GraphQL::BOOLEAN_TYPE, null: true,
field :confidential, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the epic is confidential.'
field :group, GroupType, null: false,
......@@ -41,7 +41,7 @@ module Types
field :start_date, Types::TimeType, null: true,
description: 'Start date of the epic.'
field :start_date_is_fixed, GraphQL::BOOLEAN_TYPE, null: true,
field :start_date_is_fixed, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the start date has been manually set.',
method: :start_date_is_fixed?, authorize: :admin_epic
field :start_date_fixed, Types::TimeType, null: true,
......@@ -53,7 +53,7 @@ module Types
field :due_date, Types::TimeType, null: true,
description: 'Due date of the epic.'
field :due_date_is_fixed, GraphQL::BOOLEAN_TYPE, null: true,
field :due_date_is_fixed, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the due date has been manually set.',
method: :due_date_is_fixed?, authorize: :admin_epic
field :due_date_fixed, Types::TimeType, null: true,
......@@ -63,15 +63,15 @@ module Types
description: 'Inherited due date of the epic from milestones.',
authorize: :admin_epic
field :upvotes, GraphQL::INT_TYPE, null: false,
field :upvotes, GraphQL::Types::Int, null: false,
description: 'Number of upvotes the epic has received.'
field :downvotes, GraphQL::INT_TYPE, null: false,
field :downvotes, GraphQL::Types::Int, null: false,
description: 'Number of downvotes the epic has received.'
field :user_notes_count, GraphQL::INT_TYPE, null: false,
field :user_notes_count, GraphQL::Types::Int, null: false,
description: 'Number of user notes of the epic.',
resolver: Resolvers::UserNotesCountResolver
field :user_discussions_count, GraphQL::INT_TYPE, null: false,
field :user_discussions_count, GraphQL::Types::Int, null: false,
description: 'Number of user discussions in the epic.',
resolver: Resolvers::UserDiscussionsCountResolver
......@@ -89,31 +89,31 @@ module Types
field :labels, Types::LabelType.connection_type, null: true,
description: 'Labels assigned to the epic.'
field :has_children, GraphQL::BOOLEAN_TYPE, null: false,
field :has_children, GraphQL::Types::Boolean, null: false,
description: 'Indicates if the epic has children.'
field :has_issues, GraphQL::BOOLEAN_TYPE, null: false,
field :has_issues, GraphQL::Types::Boolean, null: false,
description: 'Indicates if the epic has direct issues.'
field :has_parent, GraphQL::BOOLEAN_TYPE, null: false,
field :has_parent, GraphQL::Types::Boolean, null: false,
method: :has_parent?,
description: 'Indicates if the epic has a parent epic.'
field :web_path, GraphQL::STRING_TYPE, null: false,
field :web_path, GraphQL::Types::String, null: false,
description: 'Web path of the epic.',
method: :group_epic_path
field :web_url, GraphQL::STRING_TYPE, null: false,
field :web_url, GraphQL::Types::String, null: false,
description: 'Web URL of the epic.',
method: :group_epic_url
field :relative_position, GraphQL::INT_TYPE, null: true,
field :relative_position, GraphQL::Types::Int, null: true,
description: 'The relative position of the epic in the epic tree.'
field :relation_path, GraphQL::STRING_TYPE, null: true,
field :relation_path, GraphQL::Types::String, null: true,
description: 'URI path of the epic-issue relationship.',
method: :group_epic_link_path
field :reference, GraphQL::STRING_TYPE, null: false,
field :reference, GraphQL::Types::String, null: false,
description: 'Internal reference of the epic. Returned in shortened format by default.',
method: :epic_reference do
argument :full, GraphQL::BOOLEAN_TYPE, required: false, default_value: false,
argument :full, GraphQL::Types::Boolean, required: false, default_value: false,
description: 'Indicates if the reference should be returned in full.'
end
......@@ -121,7 +121,7 @@ module Types
description: 'List of participants for the epic.',
complexity: 5
field :subscribed, GraphQL::BOOLEAN_TYPE,
field :subscribed, GraphQL::Types::Boolean,
method: :subscribed?,
null: false,
complexity: 5,
......
......@@ -3,15 +3,15 @@
module Types
module Epics
class NegatedEpicFilterInputType < BaseInputObject
argument :label_name, [GraphQL::STRING_TYPE, null: true],
argument :label_name, [GraphQL::Types::String, null: true],
required: false,
description: 'Filter by label name.'
argument :author_username, GraphQL::STRING_TYPE,
argument :author_username, GraphQL::Types::String,
required: false,
description: 'Filter by author username.'
argument :my_reaction_emoji, GraphQL::STRING_TYPE,
argument :my_reaction_emoji, GraphQL::Types::String,
required: false,
description: 'Filter by reaction emoji applied by the current user.'
end
......
......@@ -6,19 +6,19 @@ module Types
graphql_name 'ExternalIssue'
description 'Represents an external issue'
field :title, GraphQL::STRING_TYPE, null: true,
field :title, GraphQL::Types::String, null: true,
description: 'Title of the issue in the external tracker.'
field :relative_reference, GraphQL::STRING_TYPE, null: true,
field :relative_reference, GraphQL::Types::String, null: true,
description: 'Relative reference of the issue in the external tracker.'
field :status, GraphQL::STRING_TYPE, null: true,
field :status, GraphQL::Types::String, null: true,
description: 'Status of the issue in the external tracker.'
field :external_tracker, GraphQL::STRING_TYPE, null: true,
field :external_tracker, GraphQL::Types::String, null: true,
description: 'Type of external tracker.'
field :web_url, GraphQL::STRING_TYPE, null: true,
field :web_url, GraphQL::Types::String, null: true,
description: 'URL to the issue in the external tracker.'
field :created_at, Types::TimeType, null: true,
......
......@@ -7,21 +7,21 @@ module Types
authorize :read_geo_node
field :id, GraphQL::ID_TYPE, null: false, description: 'ID of this GeoNode.'
field :primary, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates whether this Geo node is the primary.'
field :enabled, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates whether this Geo node is enabled.'
field :name, GraphQL::STRING_TYPE, null: true, description: 'The unique identifier for this Geo node.'
field :url, GraphQL::STRING_TYPE, null: true, description: 'The user-facing URL for this Geo node.'
field :internal_url, GraphQL::STRING_TYPE, null: true, description: 'The URL defined on the primary node that secondary nodes should use to contact it.'
field :files_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of LFS/attachment backfill for this secondary node.'
field :repos_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of repository backfill for this secondary node.'
field :verification_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of repository verification for this secondary node.'
field :container_repositories_max_capacity, GraphQL::INT_TYPE, null: true, description: 'The maximum concurrency of container repository sync for this secondary node.'
field :sync_object_storage, GraphQL::BOOLEAN_TYPE, null: true, description: 'Indicates if this secondary node will replicate blobs in Object Storage.'
field :selective_sync_type, GraphQL::STRING_TYPE, null: true, description: 'Indicates if syncing is limited to only specific groups, or shards.'
field :selective_sync_shards, type: [GraphQL::STRING_TYPE], null: true, description: 'The repository storages whose projects should be synced, if `selective_sync_type` == `shards`.'
field :id, GraphQL::Types::ID, null: false, description: 'ID of this GeoNode.'
field :primary, GraphQL::Types::Boolean, null: true, description: 'Indicates whether this Geo node is the primary.'
field :enabled, GraphQL::Types::Boolean, null: true, description: 'Indicates whether this Geo node is enabled.'
field :name, GraphQL::Types::String, null: true, description: 'The unique identifier for this Geo node.'
field :url, GraphQL::Types::String, null: true, description: 'The user-facing URL for this Geo node.'
field :internal_url, GraphQL::Types::String, null: true, description: 'The URL defined on the primary node that secondary nodes should use to contact it.'
field :files_max_capacity, GraphQL::Types::Int, null: true, description: 'The maximum concurrency of LFS/attachment backfill for this secondary node.'
field :repos_max_capacity, GraphQL::Types::Int, null: true, description: 'The maximum concurrency of repository backfill for this secondary node.'
field :verification_max_capacity, GraphQL::Types::Int, null: true, description: 'The maximum concurrency of repository verification for this secondary node.'
field :container_repositories_max_capacity, GraphQL::Types::Int, null: true, description: 'The maximum concurrency of container repository sync for this secondary node.'
field :sync_object_storage, GraphQL::Types::Boolean, null: true, description: 'Indicates if this secondary node will replicate blobs in Object Storage.'
field :selective_sync_type, GraphQL::Types::String, null: true, description: 'Indicates if syncing is limited to only specific groups, or shards.'
field :selective_sync_shards, type: [GraphQL::Types::String], null: true, description: 'The repository storages whose projects should be synced, if `selective_sync_type` == `shards`.'
field :selective_sync_namespaces, ::Types::NamespaceType.connection_type, null: true, method: :namespaces, description: 'The namespaces that should be synced, if `selective_sync_type` == `namespaces`.'
field :minimum_reverification_interval, GraphQL::INT_TYPE, null: true, description: 'The interval (in days) in which the repository verification is valid. Once expired, it will be reverified.'
field :minimum_reverification_interval, GraphQL::Types::Int, null: true, description: 'The interval (in days) in which the repository verification is valid. Once expired, it will be reverified.'
field :merge_request_diff_registries, ::Types::Geo::MergeRequestDiffRegistryType.connection_type,
null: true,
resolver: ::Resolvers::Geo::MergeRequestDiffRegistriesResolver,
......
......@@ -9,7 +9,7 @@ module Types
graphql_name 'GroupWikiRepositoryRegistry'
description 'Represents the Geo sync and verification state of a group wiki repository'
field :group_wiki_repository_id, GraphQL::ID_TYPE, null: false, description: 'ID of the Group Wiki Repository.'
field :group_wiki_repository_id, GraphQL::Types::ID, null: false, description: 'ID of the Group Wiki Repository.'
end
end
end
......@@ -9,7 +9,7 @@ module Types
graphql_name 'LfsObjectRegistry'
description 'Represents the Geo sync and verification state of an LFS object'
field :lfs_object_id, GraphQL::ID_TYPE, null: false, description: 'ID of the LFS object.'
field :lfs_object_id, GraphQL::Types::ID, null: false, description: 'ID of the LFS object.'
end
end
end
......@@ -9,7 +9,7 @@ module Types
graphql_name 'MergeRequestDiffRegistry'
description 'Represents the Geo sync and verification state of a Merge Request diff'
field :merge_request_diff_id, GraphQL::ID_TYPE, null: false, description: 'ID of the Merge Request diff.'
field :merge_request_diff_id, GraphQL::Types::ID, null: false, description: 'ID of the Merge Request diff.'
end
end
end
......@@ -9,7 +9,7 @@ module Types
graphql_name 'PackageFileRegistry'
description 'Represents the Geo sync and verification state of a package file'
field :package_file_id, GraphQL::ID_TYPE, null: false, description: 'ID of the PackageFile.'
field :package_file_id, GraphQL::Types::ID, null: false, description: 'ID of the PackageFile.'
end
end
end
......@@ -9,7 +9,7 @@ module Types
graphql_name 'PipelineArtifactRegistry'
description 'Represents the Geo sync and verification state of a pipeline artifact'
field :pipeline_artifact_id, GraphQL::ID_TYPE, null: false, description: 'ID of the pipeline artifact.'
field :pipeline_artifact_id, GraphQL::Types::ID, null: false, description: 'ID of the pipeline artifact.'
end
end
end
......@@ -8,10 +8,10 @@ module Types
included do
authorize :read_geo_registry
field :id, GraphQL::ID_TYPE, null: false, description: "ID of the #{graphql_name}"
field :id, GraphQL::Types::ID, null: false, description: "ID of the #{graphql_name}"
field :state, Types::Geo::RegistryStateEnum, null: true, method: :state_name, description: "Sync state of the #{graphql_name}"
field :retry_count, GraphQL::INT_TYPE, null: true, description: "Number of consecutive failed sync attempts of the #{graphql_name}"
field :last_sync_failure, GraphQL::STRING_TYPE, null: true, description: "Error message during sync of the #{graphql_name}"
field :retry_count, GraphQL::Types::Int, null: true, description: "Number of consecutive failed sync attempts of the #{graphql_name}"
field :last_sync_failure, GraphQL::Types::String, null: true, description: "Error message during sync of the #{graphql_name}"
field :retry_at, Types::TimeType, null: true, description: "Timestamp after which the #{graphql_name} should be resynced"
field :last_synced_at, Types::TimeType, null: true, description: "Timestamp of the most recent successful sync of the #{graphql_name}"
field :created_at, Types::TimeType, null: true, description: "Timestamp when the #{graphql_name} was created"
......
......@@ -9,7 +9,7 @@ module Types
graphql_name 'SnippetRepositoryRegistry'
description 'Represents the Geo sync and verification state of a snippet repository'
field :snippet_repository_id, GraphQL::ID_TYPE, null: false, description: 'ID of the Snippet Repository.'
field :snippet_repository_id, GraphQL::Types::ID, null: false, description: 'ID of the Snippet Repository.'
end
end
end
......@@ -9,7 +9,7 @@ module Types
graphql_name 'TerraformStateVersionRegistry'
description 'Represents the Geo sync and verification state of a terraform state version'
field :terraform_state_version_id, GraphQL::ID_TYPE, null: false, description: 'ID of the terraform state version.'
field :terraform_state_version_id, GraphQL::Types::ID, null: false, description: 'ID of the terraform state version.'
end
end
end
......@@ -7,14 +7,14 @@ module Types
authorize :read_group_release_stats
field :releases_count, GraphQL::INT_TYPE, null: true,
field :releases_count, GraphQL::Types::Int, null: true,
description: 'Total number of releases in all descendant projects of the group.'
def releases_count
object.releases_count
end
field :releases_percentage, GraphQL::INT_TYPE, null: true,
field :releases_percentage, GraphQL::Types::Int, null: true,
description: "Percentage of the group's descendant projects that have at least one release."
def releases_percentage
......
......@@ -12,11 +12,11 @@ module Types
null: true,
description: 'ID of the escalation policy.'
field :name, GraphQL::STRING_TYPE,
field :name, GraphQL::Types::String,
null: true,
description: 'The name of the escalation policy.'
field :description, GraphQL::STRING_TYPE,
field :description, GraphQL::Types::String,
null: true,
description: 'The description of the escalation policy.'
......
......@@ -6,11 +6,11 @@ module Types
graphql_name 'EscalationRuleInput'
description 'Represents an escalation rule'
argument :oncall_schedule_iid, GraphQL::ID_TYPE, # rubocop: disable Graphql/IDType
argument :oncall_schedule_iid, GraphQL::Types::ID, # rubocop: disable Graphql/IDType
description: 'The on-call schedule to notify.',
required: true
argument :elapsed_time_seconds, GraphQL::INT_TYPE,
argument :elapsed_time_seconds, GraphQL::Types::Int,
description: 'The time in seconds before the rule is activated.',
required: true
......
......@@ -15,7 +15,7 @@ module Types
null: true,
description: 'The on-call schedule to notify.'
field :elapsed_time_seconds, GraphQL::INT_TYPE,
field :elapsed_time_seconds, GraphQL::Types::Int,
null: true,
description: 'The time in seconds before the rule is activated.'
......
......@@ -16,11 +16,11 @@ module Types
null: false,
description: 'The user who is participating.'
field :color_palette, GraphQL::STRING_TYPE,
field :color_palette, GraphQL::Types::String,
null: true,
description: 'The color palette to assign to the on-call user. For example "blue".'
field :color_weight, GraphQL::STRING_TYPE,
field :color_weight, GraphQL::Types::String,
null: true,
description: 'The color weight to assign to for the on-call user, for example "500". Max 4 chars. For easy identification of the user.'
end
......
......@@ -7,11 +7,11 @@ module Types
graphql_name 'OncallRotationActivePeriodInputType'
description 'Active period time range for on-call rotation'
argument :start_time, GraphQL::STRING_TYPE,
argument :start_time, GraphQL::Types::String,
required: true,
description: 'The start of the rotation active period in 24 hour format, for example "18:30".'
argument :end_time, GraphQL::STRING_TYPE,
argument :end_time, GraphQL::Types::String,
required: true,
description: 'The end of the rotation active period in 24 hour format, for example "18:30".'
end
......
......@@ -7,11 +7,11 @@ module Types
graphql_name 'OncallRotationActivePeriodType'
description 'Active period time range for on-call rotation'
field :start_time, GraphQL::STRING_TYPE,
field :start_time, GraphQL::Types::String,
null: true,
description: 'The start of the rotation active period.'
field :end_time, GraphQL::STRING_TYPE,
field :end_time, GraphQL::Types::String,
null: true,
description: 'The end of the rotation active period.'
......
......@@ -6,11 +6,11 @@ module Types
graphql_name 'OncallRotationDateInputType'
description 'Date input type for on-call rotation'
argument :date, GraphQL::STRING_TYPE,
argument :date, GraphQL::Types::String,
required: true,
description: 'The date component of the date in YYYY-MM-DD format.'
argument :time, GraphQL::STRING_TYPE,
argument :time, GraphQL::Types::String,
required: true,
description: 'The time component of the date in 24hr HH:MM format.'
......
......@@ -6,7 +6,7 @@ module Types
graphql_name 'OncallRotationLengthInputType'
description 'The rotation length of the on-call rotation'
argument :length, GraphQL::INT_TYPE,
argument :length, GraphQL::Types::Int,
required: true,
description: 'The rotation length of the on-call rotation.'
......
......@@ -16,7 +16,7 @@ module Types
description: 'ID of the on-call rotation.'
field :name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'Name of the on-call rotation.'
......@@ -31,7 +31,7 @@ module Types
description: 'End date and time of the on-call rotation.'
field :length,
GraphQL::INT_TYPE,
GraphQL::Types::Int,
null: true,
description: 'Length of the on-call schedule, in the units specified by lengthUnit.'
......
......@@ -9,22 +9,22 @@ module Types
authorize :read_incident_management_oncall_schedule
field :iid,
GraphQL::ID_TYPE,
GraphQL::Types::ID,
null: false,
description: 'Internal ID of the on-call schedule.'
field :name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'Name of the on-call schedule.'
field :description,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Description of the on-call schedule.'
field :timezone,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'Time zone of the on-call schedule.'
......
......@@ -6,7 +6,7 @@ module Types
graphql_name 'OncallUserInputType'
description 'The rotation user and color palette'
argument :username, GraphQL::STRING_TYPE,
argument :username, GraphQL::Types::String,
required: true,
description: 'The username of the user to participate in the on-call rotation, such as `user_one`.'
......
......@@ -11,32 +11,32 @@ module Types
implements ::Types::TimeboxReportInterface
field :id, GraphQL::ID_TYPE, null: false,
field :id, GraphQL::Types::ID, null: false,
description: 'ID of the iteration.'
field :iid, GraphQL::ID_TYPE, null: false,
field :iid, GraphQL::Types::ID, null: false,
description: 'Internal ID of the iteration.'
field :title, GraphQL::STRING_TYPE, null: false,
field :title, GraphQL::Types::String, null: false,
description: 'Title of the iteration.'
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
description: 'Description of the iteration.'
markdown_field :description_html, null: true
field :state, Types::IterationStateEnum, null: false,
description: 'State of the iteration.'
field :web_path, GraphQL::STRING_TYPE, null: false, method: :iteration_path,
field :web_path, GraphQL::Types::String, null: false, method: :iteration_path,
description: 'Web path of the iteration.'
field :web_url, GraphQL::STRING_TYPE, null: false, method: :iteration_url,
field :web_url, GraphQL::Types::String, null: false, method: :iteration_url,
description: 'Web URL of the iteration.'
field :scoped_path, GraphQL::STRING_TYPE, null: true, method: :scoped_iteration_path, extras: [:parent],
field :scoped_path, GraphQL::Types::String, null: true, method: :scoped_iteration_path, extras: [:parent],
description: 'Web path of the iteration, scoped to the query parent. Only valid for Project parents. Returns null in other contexts.'
field :scoped_url, GraphQL::STRING_TYPE, null: true, method: :scoped_iteration_url, extras: [:parent],
field :scoped_url, GraphQL::Types::String, null: true, method: :scoped_iteration_url, extras: [:parent],
description: 'Web URL of the iteration, scoped to the query parent. Only valid for Project parents. Returns null in other contexts.'
field :due_date, Types::TimeType, null: true,
......
......@@ -11,28 +11,28 @@ module Types
field :id, ::Types::GlobalIDType[::Iterations::Cadence], null: false,
description: 'Global ID of the iteration cadence.'
field :title, GraphQL::STRING_TYPE, null: false,
field :title, GraphQL::Types::String, null: false,
description: 'Title of the iteration cadence.'
field :duration_in_weeks, GraphQL::INT_TYPE, null: true,
field :duration_in_weeks, GraphQL::Types::Int, null: true,
description: 'Duration in weeks of the iterations within this cadence.'
field :iterations_in_advance, GraphQL::INT_TYPE, null: true,
field :iterations_in_advance, GraphQL::Types::Int, null: true,
description: 'Future iterations to be created when iteration cadence is set to automatic.'
field :start_date, Types::TimeType, null: true,
description: 'Timestamp of the iteration cadence start date.'
field :automatic, GraphQL::BOOLEAN_TYPE, null: true,
field :automatic, GraphQL::Types::Boolean, null: true,
description: 'Whether the iteration cadence should automatically generate future iterations.'
field :active, GraphQL::BOOLEAN_TYPE, null: true,
field :active, GraphQL::Types::Boolean, null: true,
description: 'Whether the iteration cadence is active.'
field :roll_over, GraphQL::BOOLEAN_TYPE, null: false,
field :roll_over, GraphQL::Types::Boolean, null: false,
description: 'Whether the iteration cadence should roll over issues to the next iteration or not.'
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
description: 'Description of the iteration cadence. Maximum length is 5000 characters.'
end
end
......
......@@ -8,7 +8,7 @@ module Types
description 'Configuration details for an Agent'
field :agent_name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: true,
description: 'Name of the agent.'
end
......
......@@ -7,20 +7,20 @@ module Types
authorize :read_issuable_metric_image
field :id, GraphQL::ID_TYPE, null: false,
field :id, GraphQL::Types::ID, null: false,
description: 'ID of the metric upload.'
field :iid, GraphQL::ID_TYPE, null: false,
field :iid, GraphQL::Types::ID, null: false,
description: 'Internal ID of the metric upload.'
field :url, GraphQL::STRING_TYPE, null: false,
field :url, GraphQL::Types::String, null: false,
description: 'URL of the metric source.'
field :file_name, GraphQL::STRING_TYPE, null: true,
field :file_name, GraphQL::Types::String, null: true,
description: 'File name of the metric image.',
method: :filename
field :file_path, GraphQL::STRING_TYPE, null: true,
field :file_path, GraphQL::Types::String, null: true,
description: 'File path of the metric image.'
end
end
......@@ -7,7 +7,7 @@ module Types
description 'Represents the network policy'
field :name,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'Name of the policy.'
......@@ -17,22 +17,22 @@ module Types
description: 'Kind of the policy.'
field :namespace,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'Namespace of the policy.'
field :enabled,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
null: false,
description: 'Indicates whether this policy is enabled.'
field :from_auto_devops,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
null: false,
description: 'Indicates whether this policy is created from AutoDevops.'
field :yaml,
GraphQL::STRING_TYPE,
GraphQL::Types::String,
null: false,
description: 'YAML definition of the policy.'
......
......@@ -7,7 +7,7 @@ module Types
field :id, ::Types::GlobalIDType[PathLock], null: false,
description: 'ID of the path lock.'
field :path, GraphQL::STRING_TYPE, null: true,
field :path, GraphQL::Types::String, null: true,
description: 'The locked path.'
field :user, ::Types::UserType, null: true,
......
......@@ -13,7 +13,7 @@ module Types
description: 'Type of the security report that found the vulnerability finding.'
field :name,
type: GraphQL::STRING_TYPE,
type: GraphQL::Types::String,
null: true,
description: 'Name of the vulnerability finding.'
......@@ -23,7 +23,7 @@ module Types
description: 'Severity of the vulnerability finding.'
field :confidence,
type: GraphQL::STRING_TYPE,
type: GraphQL::Types::String,
null: true,
description: 'Type of the security report that found the vulnerability.'
......@@ -38,12 +38,12 @@ module Types
description: 'Identifiers of the vulnerabilit finding.'
field :project_fingerprint,
type: GraphQL::STRING_TYPE,
type: GraphQL::Types::String,
null: true,
description: 'Name of the vulnerability finding.'
field :uuid,
type: GraphQL::STRING_TYPE,
type: GraphQL::Types::String,
null: true,
description: 'Name of the vulnerability finding.'
......@@ -53,7 +53,7 @@ module Types
description: 'The project on which the vulnerability finding was found.'
field :description,
type: GraphQL::STRING_TYPE,
type: GraphQL::Types::String,
null: true,
description: 'Description of the vulnerability finding.'
......@@ -66,7 +66,7 @@ module Types
DESC
field :solution,
type: GraphQL::STRING_TYPE,
type: GraphQL::Types::String,
null: true,
description: "URL to the vulnerability's details page."
......
......@@ -9,7 +9,7 @@ module Types
authorize :read_project
field :reject_unsigned_commits,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
null: false,
description: 'Indicates whether commits not signed through GPG will be rejected.'
......
......@@ -7,8 +7,8 @@ module Types
graphql_name 'RequirementStatesCount'
description 'Counts of requirements by their state'
field :opened, GraphQL::INT_TYPE, null: true, description: 'Number of opened requirements.'
field :archived, GraphQL::INT_TYPE, null: true, description: 'Number of archived requirements.'
field :opened, GraphQL::Types::Int, null: true, description: 'Number of opened requirements.'
field :archived, GraphQL::Types::Int, null: true, description: 'Number of archived requirements.'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......
......@@ -10,17 +10,17 @@ module Types
expose_permissions Types::PermissionTypes::Requirement
field :id, GraphQL::ID_TYPE, null: false,
field :id, GraphQL::Types::ID, null: false,
description: 'ID of the requirement.'
field :iid, GraphQL::ID_TYPE, null: false,
field :iid, GraphQL::Types::ID, null: false,
description: 'Internal ID of the requirement.'
field :title, GraphQL::STRING_TYPE, null: true,
field :title, GraphQL::Types::String, null: true,
description: 'Title of the requirement.'
markdown_field :title_html, null: true
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
description: 'Description of the requirement.'
markdown_field :description_html, null: true
......@@ -31,7 +31,7 @@ module Types
description: 'Latest requirement test report state.'
field :last_test_report_manually_created,
GraphQL::BOOLEAN_TYPE,
GraphQL::Types::Boolean,
method: :last_test_report_manually_created?,
null: true,
description: 'Indicates if latest test report was created by user.'
......
......@@ -8,7 +8,7 @@ module Types
authorize :read_requirement
field :id, GraphQL::ID_TYPE, null: false,
field :id, GraphQL::Types::ID, null: false,
description: 'ID of the test report.'
field :state, TestReportStateEnum, null: false,
......
......@@ -6,10 +6,10 @@ module Types
graphql_name 'ScanExecutionPolicy'
description 'Represents the scan execution policy'
field :name, GraphQL::STRING_TYPE, null: false, description: 'Name of the policy.'
field :description, GraphQL::STRING_TYPE, null: false, description: 'Description of the policy.'
field :enabled, GraphQL::BOOLEAN_TYPE, null: false, description: 'Indicates whether this policy is enabled.'
field :yaml, GraphQL::STRING_TYPE, null: false, description: 'YAML definition of the policy.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the policy.'
field :description, GraphQL::Types::String, null: false, description: 'Description of the policy.'
field :enabled, GraphQL::Types::Boolean, null: false, description: 'Indicates whether this policy is enabled.'
field :yaml, GraphQL::Types::String, null: false, description: 'YAML definition of the policy.'
field :updated_at, Types::TimeType, null: false, description: 'Timestamp of when the policy YAML was last updated.'
end
end
......@@ -10,7 +10,7 @@ module Types
authorize :read_scan
field :name, GraphQL::STRING_TYPE, null: false, description: 'Name of the scan.'
field :errors, [GraphQL::STRING_TYPE], null: false, description: 'List of errors.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the scan.'
field :errors, [GraphQL::Types::String], null: false, description: 'List of errors.'
end
end
......@@ -6,7 +6,7 @@ module Types
graphql_name 'ScannedResource'
description 'Represents a resource scanned by a security scan'
field :url, GraphQL::STRING_TYPE, null: true, description: 'The URL scanned by the scanner.'
field :request_method, GraphQL::STRING_TYPE, null: true, description: 'The HTTP request method used to access the URL.'
field :url, GraphQL::Types::String, null: true, description: 'The URL scanned by the scanner.'
field :request_method, GraphQL::Types::String, null: true, description: 'The HTTP request method used to access the URL.'
end
end
......@@ -6,10 +6,10 @@ module Types
graphql_name 'SecurityReportSummarySection'
description 'Represents a section of a summary of a security report'
field :vulnerabilities_count, GraphQL::INT_TYPE, null: true, description: 'Total number of vulnerabilities.'
field :scanned_resources_count, GraphQL::INT_TYPE, null: true, description: 'Total number of scanned resources.'
field :vulnerabilities_count, GraphQL::Types::Int, null: true, description: 'Total number of vulnerabilities.'
field :scanned_resources_count, GraphQL::Types::Int, null: true, description: 'Total number of scanned resources.'
field :scanned_resources, ::Types::ScannedResourceType.connection_type, null: true, description: 'A list of the first 20 scanned resources.'
field :scanned_resources_csv_path, GraphQL::STRING_TYPE, null: true, description: 'Path to download all the scanned resources in CSV format.'
field :scanned_resources_csv_path, GraphQL::Types::String, null: true, description: 'Path to download all the scanned resources in CSV format.'
field :scans, ::Types::ScanType.connection_type, null: false, description: 'List of security scans ran for the type.'
end
end
......@@ -6,10 +6,10 @@ module Types
graphql_name 'TimeboxMetrics'
description 'Represents measured stats metrics for timeboxes'
field :count, GraphQL::INT_TYPE, null: false,
field :count, GraphQL::Types::Int, null: false,
description: 'The count metric.'
field :weight, GraphQL::INT_TYPE, null: false,
field :weight, GraphQL::Types::Int, null: false,
description: 'The weight metric.'
end
end
......@@ -9,11 +9,11 @@ module Types
field :date, GraphQL::Types::ISO8601Date, null: false,
description: 'Date for the count.'
field :total, GraphQL::INT_TYPE, null: false,
field :total, GraphQL::Types::Int, null: false,
description: 'Total number of vulnerabilities on a particular day.'
::Enums::Vulnerability.severity_levels.keys.each do |severity|
field severity.to_s, GraphQL::INT_TYPE, null: false,
field severity.to_s, GraphQL::Types::Int, null: false,
description: "Total number of vulnerabilities on a particular day with #{severity} severity"
end
end
......
......@@ -8,7 +8,7 @@ module Types
authorize :read_issue_link
field :id, GraphQL::ID_TYPE, null: false,
field :id, GraphQL::Types::ID, null: false,
description: 'GraphQL ID of the vulnerability.'
field :link_type, ::Types::Vulnerability::IssueLinkTypeEnum, null: false,
......
......@@ -7,13 +7,13 @@ module Types
graphql_name 'VulnerabilityDetailBase'
description 'Represents the vulnerability details base'
field :field_name, GraphQL::STRING_TYPE, null: true,
field :field_name, GraphQL::Types::String, null: true,
description: 'Name of the field.'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
description: 'Name of the field.'
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
description: 'Description of the field.'
end
end
......
......@@ -7,7 +7,7 @@ module Types
graphql_name 'VulnerabilityDetailBoolean'
description 'Represents the vulnerability details boolean value'
field :value, GraphQL::BOOLEAN_TYPE, null: false,
field :value, GraphQL::Types::Boolean, null: false,
description: 'Value of the field.'
end
end
......
......@@ -7,10 +7,10 @@ module Types
graphql_name 'VulnerabilityDetailCode'
description 'Represents the vulnerability details code field'
field :lang, GraphQL::STRING_TYPE, null: true,
field :lang, GraphQL::Types::String, null: true,
description: 'Language of the code.'
field :value, GraphQL::STRING_TYPE, null: false,
field :value, GraphQL::Types::String, null: false,
description: 'Source code.'
end
end
......
......@@ -7,7 +7,7 @@ module Types
graphql_name 'VulnerabilityDetailCommit'
description 'Represents the vulnerability details commit field'
field :value, GraphQL::STRING_TYPE, null: false,
field :value, GraphQL::Types::String, null: false,
description: 'The commit SHA value.'
end
end
......
......@@ -7,10 +7,10 @@ module Types
graphql_name 'VulnerabilityDetailDiff'
description 'Represents the vulnerability details diff field'
field :before, GraphQL::STRING_TYPE, null: false,
field :before, GraphQL::Types::String, null: false,
description: 'Value of the field before the change.'
field :after, GraphQL::STRING_TYPE, null: false,
field :after, GraphQL::Types::String, null: false,
description: 'Value of the field after the change.'
end
end
......
......@@ -7,13 +7,13 @@ module Types
graphql_name 'VulnerabilityDetailFileLocation'
description 'Represents the vulnerability details location within a file in the project'
field :file_name, GraphQL::STRING_TYPE, null: false,
field :file_name, GraphQL::Types::String, null: false,
description: 'File name.'
field :line_start, GraphQL::INT_TYPE, null: false,
field :line_start, GraphQL::Types::Int, null: false,
description: 'Start line number of the file location.'
field :line_end, GraphQL::INT_TYPE, null: false,
field :line_end, GraphQL::Types::Int, null: false,
description: 'End line number of the file location.'
end
end
......
......@@ -7,7 +7,7 @@ module Types
graphql_name 'VulnerabilityDetailInt'
description 'Represents the vulnerability details integer value'
field :value, GraphQL::INT_TYPE, null: false,
field :value, GraphQL::Types::Int, null: false,
description: 'Value of the field.'
end
end
......
......@@ -7,7 +7,7 @@ module Types
graphql_name 'VulnerabilityDetailMarkdown'
description 'Represents the vulnerability details Markdown field'
field :value, GraphQL::STRING_TYPE, null: false,
field :value, GraphQL::Types::String, null: false,
description: 'Value of the Markdown field.'
end
end
......
......@@ -7,10 +7,10 @@ module Types
graphql_name 'VulnerabilityDetailModuleLocation'
description 'Represents the vulnerability details location within a file in the project'
field :module_name, GraphQL::STRING_TYPE, null: false,
field :module_name, GraphQL::Types::String, null: false,
description: 'Module name.'
field :offset, GraphQL::INT_TYPE, null: false,
field :offset, GraphQL::Types::Int, null: false,
description: 'Offset of the module location.'
end
end
......
......@@ -7,7 +7,7 @@ module Types
graphql_name 'VulnerabilityDetailText'
description 'Represents the vulnerability details text field'
field :value, GraphQL::STRING_TYPE, null: false,
field :value, GraphQL::Types::String, null: false,
description: 'Value of the text field.'
end
end
......
......@@ -7,10 +7,10 @@ module Types
graphql_name 'VulnerabilityDetailUrl'
description 'Represents the vulnerability details URL field'
field :text, GraphQL::STRING_TYPE, null: true,
field :text, GraphQL::Types::String, null: true,
description: 'Text of the URL.'
field :href, GraphQL::STRING_TYPE, null: false,
field :href, GraphQL::Types::String, null: false,
description: 'Href of the URL.'
end
end
......
......@@ -6,16 +6,16 @@ module Types
graphql_name 'VulnerabilityIdentifier'
description 'Represents a vulnerability identifier'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
description: 'Name of the vulnerability identifier.'
field :url, GraphQL::STRING_TYPE, null: true,
field :url, GraphQL::Types::String, null: true,
description: 'URL of the vulnerability identifier.'
field :external_type, GraphQL::STRING_TYPE, null: true,
field :external_type, GraphQL::Types::String, null: true,
description: 'External type of the vulnerability identifier.'
field :external_id, GraphQL::STRING_TYPE, null: true,
field :external_id, GraphQL::Types::String, null: true,
description: 'External ID of the vulnerability identifier.'
end
# rubocop: enable Graphql/AuthorizeTypes
......
......@@ -10,10 +10,10 @@ module Types
field :dependency, ::Types::VulnerableDependencyType, null: true,
description: 'Dependency containing the vulnerability.'
field :image, GraphQL::STRING_TYPE, null: true,
field :image, GraphQL::Types::String, null: true,
description: 'Name of the vulnerable container image.'
field :operating_system, GraphQL::STRING_TYPE, null: true,
field :operating_system, GraphQL::Types::String, null: true,
description: 'Operating system that runs on the vulnerable container image.'
end
end
......
......@@ -7,24 +7,24 @@ module Types
graphql_name 'VulnerabilityLocationCoverageFuzzing'
description 'Represents the location of a vulnerability found by a Coverage Fuzzing scan'
field :vulnerable_class, GraphQL::STRING_TYPE, null: true,
field :vulnerable_class, GraphQL::Types::String, null: true,
description: 'Class containing the vulnerability.',
hash_key: :class
field :end_line, GraphQL::STRING_TYPE, null: true,
field :end_line, GraphQL::Types::String, null: true,
description: 'Number of the last relevant line in the vulnerable file.'
field :file, GraphQL::STRING_TYPE, null: true,
field :file, GraphQL::Types::String, null: true,
description: 'Path to the vulnerable file.'
field :vulnerable_method, GraphQL::STRING_TYPE, null: true,
field :vulnerable_method, GraphQL::Types::String, null: true,
description: 'Method containing the vulnerability.',
hash_key: :method
field :start_line, GraphQL::STRING_TYPE, null: true,
field :start_line, GraphQL::Types::String, null: true,
description: 'Number of the first relevant line in the vulnerable file.'
field :blob_path, GraphQL::STRING_TYPE, null: true,
field :blob_path, GraphQL::Types::String, null: true,
description: 'Blob path to the vulnerable file.'
end
end
......
......@@ -7,16 +7,16 @@ module Types
graphql_name 'VulnerabilityLocationDast'
description 'Represents the location of a vulnerability found by a DAST scan'
field :hostname, GraphQL::STRING_TYPE, null: true,
field :hostname, GraphQL::Types::String, null: true,
description: 'Domain name of the vulnerable request.'
field :param, GraphQL::STRING_TYPE, null: true,
field :param, GraphQL::Types::String, null: true,
description: 'Query parameter for the URL on which the vulnerability occurred.'
field :path, GraphQL::STRING_TYPE, null: true,
field :path, GraphQL::Types::String, null: true,
description: 'URL path and query string of the vulnerable request.'
field :request_method, GraphQL::STRING_TYPE, null: true,
field :request_method, GraphQL::Types::String, null: true,
description: 'HTTP method of the vulnerable request.'
end
end
......
......@@ -10,10 +10,10 @@ module Types
field :dependency, ::Types::VulnerableDependencyType, null: true,
description: 'Dependency containing the vulnerability.'
field :file, GraphQL::STRING_TYPE, null: true,
field :file, GraphQL::Types::String, null: true,
description: 'Path to the vulnerable file.'
field :blob_path, GraphQL::STRING_TYPE, null: true,
field :blob_path, GraphQL::Types::String, null: true,
description: 'Blob path to the vulnerable file.'
end
end
......
......@@ -7,24 +7,24 @@ module Types
graphql_name 'VulnerabilityLocationSast'
description 'Represents the location of a vulnerability found by a SAST scan'
field :vulnerable_class, GraphQL::STRING_TYPE, null: true,
field :vulnerable_class, GraphQL::Types::String, null: true,
description: 'Class containing the vulnerability.',
hash_key: :class
field :end_line, GraphQL::STRING_TYPE, null: true,
field :end_line, GraphQL::Types::String, null: true,
description: 'Number of the last relevant line in the vulnerable file.'
field :file, GraphQL::STRING_TYPE, null: true,
field :file, GraphQL::Types::String, null: true,
description: 'Path to the vulnerable file.'
field :vulnerable_method, GraphQL::STRING_TYPE, null: true,
field :vulnerable_method, GraphQL::Types::String, null: true,
description: 'Method containing the vulnerability.',
hash_key: :method
field :start_line, GraphQL::STRING_TYPE, null: true,
field :start_line, GraphQL::Types::String, null: true,
description: 'Number of the first relevant line in the vulnerable file.'
field :blob_path, GraphQL::STRING_TYPE, null: true,
field :blob_path, GraphQL::Types::String, null: true,
description: 'Blob path to the vulnerable file.'
end
end
......
......@@ -7,24 +7,24 @@ module Types
graphql_name 'VulnerabilityLocationSecretDetection'
description 'Represents the location of a vulnerability found by a secret detection scan'
field :vulnerable_class, GraphQL::STRING_TYPE, null: true,
field :vulnerable_class, GraphQL::Types::String, null: true,
description: 'Class containing the vulnerability.',
hash_key: :class
field :end_line, GraphQL::STRING_TYPE, null: true,
field :end_line, GraphQL::Types::String, null: true,
description: 'Number of the last relevant line in the vulnerable file.'
field :file, GraphQL::STRING_TYPE, null: true,
field :file, GraphQL::Types::String, null: true,
description: 'Path to the vulnerable file.'
field :vulnerable_method, GraphQL::STRING_TYPE, null: true,
field :vulnerable_method, GraphQL::Types::String, null: true,
description: 'Method containing the vulnerability.',
hash_key: :method
field :start_line, GraphQL::STRING_TYPE, null: true,
field :start_line, GraphQL::Types::String, null: true,
description: 'Number of the first relevant line in the vulnerable file.'
field :blob_path, GraphQL::STRING_TYPE, null: true,
field :blob_path, GraphQL::Types::String, null: true,
description: 'Blob path to the vulnerable file.'
end
end
......
......@@ -7,16 +7,16 @@ module Types
authorize :read_vulnerability_scanner
field :id, GraphQL::ID_TYPE, null: true,
field :id, GraphQL::Types::ID, null: true,
description: 'ID of the scanner.'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
description: 'Name of the vulnerability scanner.'
field :external_id, GraphQL::STRING_TYPE, null: true,
field :external_id, GraphQL::Types::String, null: true,
description: 'External ID of the vulnerability scanner.'
field :vendor, GraphQL::STRING_TYPE, null: true,
field :vendor, GraphQL::Types::String, null: true,
description: 'Vendor of the vulnerability scanner.'
field :report_type, VulnerabilityReportTypeEnum, null: true,
......
......@@ -7,7 +7,7 @@ module Types
description 'Represents vulnerability counts by severity'
::Enums::Vulnerability.severity_levels.keys.each do |severity|
field severity, GraphQL::INT_TYPE, null: true,
field severity, GraphQL::Types::Int, null: true,
description: "Number of vulnerabilities of #{severity.upcase} severity of the project"
end
end
......
......@@ -11,13 +11,13 @@ module Types
expose_permissions Types::PermissionTypes::Vulnerability
field :id, GraphQL::ID_TYPE, null: false,
field :id, GraphQL::Types::ID, null: false,
description: 'GraphQL ID of the vulnerability.'
field :title, GraphQL::STRING_TYPE, null: true,
field :title, GraphQL::Types::String, null: true,
description: 'Title of the vulnerability.'
field :description, GraphQL::STRING_TYPE, null: true,
field :description, GraphQL::Types::String, null: true,
description: 'Description of the vulnerability.'
field :state, VulnerabilityStateEnum, null: true,
......@@ -29,13 +29,13 @@ module Types
field :report_type, VulnerabilityReportTypeEnum, null: true,
description: "Type of the security report that found the vulnerability (#{::Enums::Vulnerability.report_types.keys.join(', ').upcase}). `Scan Type` in the UI."
field :resolved_on_default_branch, GraphQL::BOOLEAN_TYPE, null: false,
field :resolved_on_default_branch, GraphQL::Types::Boolean, null: false,
description: "Indicates whether the vulnerability is fixed on the default branch or not."
field :user_notes_count, GraphQL::INT_TYPE, null: false,
field :user_notes_count, GraphQL::Types::Int, null: false,
description: 'Number of user notes attached to the vulnerability.'
field :vulnerability_path, GraphQL::STRING_TYPE, null: true,
field :vulnerability_path, GraphQL::Types::String, null: true,
description: "URL to the vulnerability's details page."
field :issue_links, ::Types::Vulnerability::IssueLinkType.connection_type, null: false,
......@@ -74,7 +74,7 @@ module Types
field :dismissed_at, Types::TimeType, null: true,
description: 'Timestamp of when the vulnerability state was changed to dismissed.'
field :has_solutions, GraphQL::BOOLEAN_TYPE, null: true,
field :has_solutions, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether there is a solution available for this vulnerability.',
resolver_method: :has_solutions?
......
......@@ -9,7 +9,7 @@ module Types
field :package, ::Types::VulnerablePackageType, null: true,
description: 'The package associated with the vulnerable dependency.'
field :version, GraphQL::STRING_TYPE, null: true,
field :version, GraphQL::Types::String, null: true,
description: 'The version of the vulnerable dependency.'
end
end
......@@ -6,7 +6,7 @@ module Types
graphql_name 'VulnerablePackage'
description 'Represents a vulnerable package. Used in vulnerability dependency data'
field :name, GraphQL::STRING_TYPE, null: true,
field :name, GraphQL::Types::String, null: true,
description: 'The name of the vulnerable package.'
end
end
......@@ -9,7 +9,7 @@ module Types
field :grade, Types::VulnerabilityGradeEnum, null: false,
description: "Grade based on the highest severity vulnerability present."
field :count, GraphQL::INT_TYPE, null: false,
field :count, GraphQL::Types::Int, null: false,
description: 'Number of projects within this grade.',
complexity: 5
......
......@@ -11,7 +11,7 @@ module Gitlab
# are always identical to the corresponding query field descriptions.
#
# E.g.:
# argument :name, GraphQL::STRING_TYPE, description: copy_field_description(Types::UserType, :name)
# argument :name, GraphQL::Types::String, description: copy_field_description(Types::UserType, :name)
def copy_field_description(type, field_name)
type.fields[field_name.to_s.camelize(:lower)].description
end
......
......@@ -19,7 +19,7 @@ module Gitlab
# Adding complexity to rendered notes since that could cause queries.
kwargs[:complexity] ||= 5
field name, GraphQL::STRING_TYPE, **kwargs
field name, GraphQL::Types::String, **kwargs
define_method resolver_method do
# We need to `dup` the context so the MarkdownHelper doesn't modify it
......
......@@ -7,16 +7,16 @@
#
# # bad
# class AwfulType
# field :some_field, GraphQL::STRING_TYPE
# field :some_field, GraphQL::Types::String
# end
#
# class TerribleType
# argument :some_argument, GraphQL::STRING_TYPE
# argument :some_argument, GraphQL::Types::String
# end
#
# class UngoodType
# field :some_argument,
# GraphQL::STRING_TYPE,
# GraphQL::Types::String,
# description: "A description that does not end in a period"
# end
#
......@@ -27,11 +27,11 @@
# # good
# class GreatType
# argument :some_field,
# GraphQL::STRING_TYPE,
# GraphQL::Types::String,
# description: "Well described - a superb description."
#
# field :some_field,
# GraphQL::STRING_TYPE,
# GraphQL::Types::String,
# description: "A thorough and compelling description."
# end
#
......
......@@ -4,12 +4,12 @@ module RuboCop
module Cop
module Graphql
class IDType < RuboCop::Cop::Cop
MSG = 'Do not use GraphQL::ID_TYPE, use a specific GlobalIDType instead'
MSG = 'Do not use GraphQL::Types::ID, use a specific GlobalIDType instead'
WHITELISTED_ARGUMENTS = %i[iid full_path project_path group_path target_project_path namespace_path].freeze
def_node_search :graphql_id_type?, <<~PATTERN
(send nil? :argument (_ #does_not_match?) (const (const nil? :GraphQL) :ID_TYPE) ...)
(send nil? :argument (_ #does_not_match?) (const (const (const nil? :GraphQL) :Types) :ID) ...)
PATTERN
def on_send(node)
......
......@@ -12,7 +12,7 @@
#
# # good
# class GreatClass
# field :some_field, GraphQL::STRING_TYPE
# field :some_field, GraphQL::Types::String
# end
module RuboCop
......
......@@ -7,7 +7,7 @@
# # bad
# module Resolvers
# class NoTypeResolver < BaseResolver
# field :some_field, GraphQL::STRING_TYPE
# field :some_field, GraphQL::Types::String
# end
# end
#
......@@ -16,7 +16,7 @@
# class WithTypeResolver < BaseResolver
# type MyType, null: true
#
# field :some_field, GraphQL::STRING_TYPE
# field :some_field, GraphQL::Types::String
# end
# end
......
......@@ -10,7 +10,7 @@ RSpec.describe Gitlab::Graphql::MarkdownField do
expect(field.name).to eq('testHtml')
expect(field.description).to eq('The GitLab Flavored Markdown rendering of `hello`')
expect(field.type).to eq(GraphQL::STRING_TYPE)
expect(field.type).to eq(GraphQL::Types::String)
expect(field.to_graphql.complexity).to eq(5)
end
......
......@@ -7,10 +7,10 @@ require_relative '../../../../rubocop/cop/graphql/id_type'
RSpec.describe RuboCop::Cop::Graphql::IDType do
subject(:cop) { described_class.new }
it 'adds an offense when GraphQL::ID_TYPE is used as a param to #argument' do
it 'adds an offense when GraphQL::Types::ID is used as a param to #argument' do
expect_offense(<<~TYPE)
argument :some_arg, GraphQL::ID_TYPE, some: other, params: do_not_matter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use GraphQL::ID_TYPE, use a specific GlobalIDType instead
argument :some_arg, GraphQL::Types::ID, some: other, params: do_not_matter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use GraphQL::Types::ID, use a specific GlobalIDType instead
TYPE
end
......@@ -18,7 +18,7 @@ RSpec.describe RuboCop::Cop::Graphql::IDType do
RuboCop::Cop::Graphql::IDType::WHITELISTED_ARGUMENTS.each do |arg|
it "does not add an offense for calls to #argument with #{arg} as argument name" do
expect_no_offenses(<<~TYPE.strip)
argument #{arg}, GraphQL::ID_TYPE, some: other, params: do_not_matter
argument #{arg}, GraphQL::Types::ID, some: other, params: do_not_matter
TYPE
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment