Commit 793bc4b8 authored by Brett Walker's avatar Brett Walker

Convert old graphql types to newer types

in prep for interpreter
parent bd058e8c
...@@ -39,47 +39,6 @@ Graphql/OldTypes: ...@@ -39,47 +39,6 @@ Graphql/OldTypes:
- 'ee/app/graphql/ee/types/merge_request_type.rb' - 'ee/app/graphql/ee/types/merge_request_type.rb'
- 'ee/app/graphql/ee/types/namespace_type.rb' - 'ee/app/graphql/ee/types/namespace_type.rb'
- 'ee/app/graphql/ee/types/project_type.rb' - 'ee/app/graphql/ee/types/project_type.rb'
- 'ee/app/graphql/resolvers/alert_management/payload_alert_field_resolver.rb'
- 'ee/app/graphql/resolvers/clusters/agents_resolver.rb'
- 'ee/app/graphql/resolvers/concerns/common_requirement_arguments.rb'
- 'ee/app/graphql/resolvers/epic_ancestors_resolver.rb'
- 'ee/app/graphql/resolvers/epics_resolver.rb'
- 'ee/app/graphql/resolvers/geo/geo_node_resolver.rb'
- 'ee/app/graphql/resolvers/instance_security_dashboard/projects_resolver.rb'
- 'ee/app/graphql/resolvers/iterations/cadences_resolver.rb'
- 'ee/app/graphql/resolvers/iterations_resolver.rb'
- 'ee/app/graphql/resolvers/requirements_management/requirements_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerabilities_grade_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerabilities_resolver.rb'
- 'ee/app/graphql/resolvers/vulnerability_severities_count_resolver.rb'
- 'ee/app/graphql/types/admin/cloud_licenses/current_license_type.rb'
- 'ee/app/graphql/types/admin/cloud_licenses/license_type.rb'
- 'ee/app/graphql/types/alert_management/payload_alert_field_input_type.rb'
- 'ee/app/graphql/types/alert_management/payload_alert_field_type.rb'
- 'ee/app/graphql/types/alert_management/payload_alert_mapping_field_type.rb'
- 'ee/app/graphql/types/analytics/devops_adoption/enabled_namespace_type.rb'
- 'ee/app/graphql/types/analytics/devops_adoption/snapshot_type.rb'
- 'ee/app/graphql/types/app_sec/fuzzing/api/scan_profile_type.rb'
- 'ee/app/graphql/types/boards/board_epic_input_type.rb'
- 'ee/app/graphql/types/boards/epic_board_type.rb'
- 'ee/app/graphql/types/boards/epic_list_type.rb'
- 'ee/app/graphql/types/boards/epic_user_preferences_type.rb'
- 'ee/app/graphql/types/burnup_chart_daily_totals_type.rb'
- 'ee/app/graphql/types/ci/code_coverage_activity_type.rb'
- 'ee/app/graphql/types/ci/code_coverage_summary_type.rb'
- 'ee/app/graphql/types/ci/code_quality_degradation_type.rb'
- 'ee/app/graphql/types/clusters/agent_token_type.rb'
- 'ee/app/graphql/types/clusters/agent_type.rb'
- 'ee/app/graphql/types/compliance_management/compliance_framework_input_type.rb'
- 'ee/app/graphql/types/compliance_management/compliance_framework_type.rb'
- 'ee/app/graphql/types/dast/profile_branch_type.rb'
- 'ee/app/graphql/types/dast/profile_type.rb'
- 'ee/app/graphql/types/dast/site_profile_auth_input_type.rb'
- 'ee/app/graphql/types/dast/site_profile_auth_type.rb'
- 'ee/app/graphql/types/dast_scanner_profile_type.rb'
- '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'
# WIP: See https://gitlab.com/gitlab-org/gitlab/-/issues/220040 # WIP: See https://gitlab.com/gitlab-org/gitlab/-/issues/220040
Rails/SaveBang: Rails/SaveBang:
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Resolvers module Resolvers
module AlertManagement module AlertManagement
class PayloadAlertFieldResolver < BaseResolver class PayloadAlertFieldResolver < BaseResolver
argument :payload_example, GraphQL::STRING_TYPE, argument :payload_example, GraphQL::Types::String,
required: true, required: true,
description: 'Sample payload for extracting alert fields for custom mappings.' description: 'Sample payload for extracting alert fields for custom mappings.'
......
...@@ -10,7 +10,7 @@ module Resolvers ...@@ -10,7 +10,7 @@ module Resolvers
extras [:lookahead] extras [:lookahead]
when_single do when_single do
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::Types::String,
required: true, required: true,
description: 'Name of the cluster agent.' description: 'Name of the cluster agent.'
end end
......
...@@ -12,11 +12,11 @@ module CommonRequirementArguments ...@@ -12,11 +12,11 @@ module CommonRequirementArguments
required: false, required: false,
description: 'Filter requirements by state.' description: 'Filter requirements by state.'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query for requirement title.' description: 'Search query for requirement title.'
argument :author_username, [GraphQL::STRING_TYPE], argument :author_username, [GraphQL::Types::String],
required: false, required: false,
description: 'Filter requirements by author username.' description: 'Filter requirements by author username.'
end end
......
...@@ -6,7 +6,7 @@ module Resolvers ...@@ -6,7 +6,7 @@ module Resolvers
type Types::DastSiteValidationType.connection_type, null: true type Types::DastSiteValidationType.connection_type, null: true
argument :normalized_target_urls, [GraphQL::STRING_TYPE], argument :normalized_target_urls, [GraphQL::Types::String],
required: false, required: false,
description: 'Normalized URL of the target to be scanned.' description: 'Normalized URL of the target to be scanned.'
......
...@@ -4,7 +4,7 @@ module Resolvers ...@@ -4,7 +4,7 @@ module Resolvers
class EpicAncestorsResolver < EpicsResolver class EpicAncestorsResolver < EpicsResolver
type Types::EpicType, null: true type Types::EpicType, null: true
argument :include_ancestor_groups, GraphQL::BOOLEAN_TYPE, argument :include_ancestor_groups, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include epics from ancestor groups.', description: 'Include epics from ancestor groups.',
default_value: true default_value: true
......
...@@ -5,11 +5,11 @@ module Resolvers ...@@ -5,11 +5,11 @@ module Resolvers
include TimeFrameArguments include TimeFrameArguments
include LooksAhead include LooksAhead
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::Types::ID,
required: false, required: false,
description: 'IID of the epic, e.g., "1".' description: 'IID of the epic, e.g., "1".'
argument :iids, [GraphQL::ID_TYPE], argument :iids, [GraphQL::Types::ID],
required: false, required: false,
description: 'List of IIDs of epics, e.g., `[1, 2]`.' description: 'List of IIDs of epics, e.g., `[1, 2]`.'
...@@ -17,7 +17,7 @@ module Resolvers ...@@ -17,7 +17,7 @@ module Resolvers
required: false, required: false,
description: 'Filter epics by state.' description: 'Filter epics by state.'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query for epic title or description.' description: 'Search query for epic title or description.'
...@@ -29,37 +29,37 @@ module Resolvers ...@@ -29,37 +29,37 @@ module Resolvers
required: false, required: false,
description: 'List epics by sort order.' description: 'List epics by sort order.'
argument :author_username, GraphQL::STRING_TYPE, argument :author_username, GraphQL::Types::String,
required: false, required: false,
description: 'Filter epics by author.' description: 'Filter epics by author.'
argument :label_name, [GraphQL::STRING_TYPE], argument :label_name, [GraphQL::Types::String],
required: false, required: false,
description: 'Filter epics by labels.' description: 'Filter epics by labels.'
argument :milestone_title, GraphQL::STRING_TYPE, argument :milestone_title, GraphQL::Types::String,
required: false, required: false,
description: "Filter epics by milestone title, computed from epic's issues." description: "Filter epics by milestone title, computed from epic's issues."
argument :iid_starts_with, GraphQL::STRING_TYPE, argument :iid_starts_with, GraphQL::Types::String,
required: false, required: false,
description: 'Filter epics by IID for autocomplete.' description: 'Filter epics by IID for autocomplete.'
argument :include_ancestor_groups, GraphQL::BOOLEAN_TYPE, argument :include_ancestor_groups, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include epics from ancestor groups.', description: 'Include epics from ancestor groups.',
default_value: false default_value: false
argument :include_descendant_groups, GraphQL::BOOLEAN_TYPE, argument :include_descendant_groups, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include epics from descendant groups.', description: 'Include epics from descendant groups.',
default_value: true default_value: true
argument :confidential, GraphQL::BOOLEAN_TYPE, argument :confidential, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Filter epics by given confidentiality.' description: 'Filter epics by given confidentiality.'
argument :my_reaction_emoji, GraphQL::STRING_TYPE, argument :my_reaction_emoji, GraphQL::Types::String,
required: false, required: false,
description: 'Filter by reaction emoji applied by the current user.' description: 'Filter by reaction emoji applied by the current user.'
......
...@@ -5,7 +5,7 @@ module Resolvers ...@@ -5,7 +5,7 @@ module Resolvers
class GeoNodeResolver < BaseResolver class GeoNodeResolver < BaseResolver
type Types::Geo::GeoNodeType, null: true type Types::Geo::GeoNodeType, null: true
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::Types::String,
required: false, required: false,
description: 'The name of the Geo node. Defaults to the current Geo node name.' description: 'The name of the Geo node. Defaults to the current Geo node name.'
......
...@@ -15,7 +15,7 @@ module Resolvers ...@@ -15,7 +15,7 @@ module Resolvers
type replicator_class.graphql_registry_type, null: true type replicator_class.graphql_registry_type, null: true
argument :ids, argument :ids,
[GraphQL::ID_TYPE], [GraphQL::Types::ID],
required: false, required: false,
description: 'Filters registries by their ID.' description: 'Filters registries by their ID.'
......
...@@ -10,7 +10,7 @@ module Resolvers ...@@ -10,7 +10,7 @@ module Resolvers
type Types::IncidentManagement::OncallScheduleType.connection_type, null: true type Types::IncidentManagement::OncallScheduleType.connection_type, null: true
argument :iids, [GraphQL::ID_TYPE], argument :iids, [GraphQL::Types::ID],
required: false, required: false,
description: 'IIDs of on-call schedules.' description: 'IIDs of on-call schedules.'
......
...@@ -5,7 +5,7 @@ module Resolvers ...@@ -5,7 +5,7 @@ module Resolvers
class ProjectsResolver < BaseResolver class ProjectsResolver < BaseResolver
type ::Types::ProjectType, null: true type ::Types::ProjectType, null: true
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query for project name, path, or description.' description: 'Search query for project name, path, or description.'
......
...@@ -9,19 +9,19 @@ module Resolvers ...@@ -9,19 +9,19 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::Iterations::Cadence], required: false, argument :id, ::Types::GlobalIDType[::Iterations::Cadence], required: false,
description: 'Global ID of the iteration cadence to look up.' description: 'Global ID of the iteration cadence to look up.'
argument :title, GraphQL::STRING_TYPE, required: false, argument :title, GraphQL::Types::String, required: false,
description: 'Fuzzy search by title.' description: 'Fuzzy search by title.'
argument :duration_in_weeks, GraphQL::INT_TYPE, required: false, argument :duration_in_weeks, GraphQL::Types::Int, required: false,
description: copy_field_description(Types::Iterations::CadenceType, :duration_in_weeks) description: copy_field_description(Types::Iterations::CadenceType, :duration_in_weeks)
argument :automatic, GraphQL::BOOLEAN_TYPE, required: false, argument :automatic, GraphQL::Types::Boolean, required: false,
description: copy_field_description(Types::Iterations::CadenceType, :automatic) description: copy_field_description(Types::Iterations::CadenceType, :automatic)
argument :active, GraphQL::BOOLEAN_TYPE, required: false, argument :active, GraphQL::Types::Boolean, required: false,
description: copy_field_description(Types::Iterations::CadenceType, :active) description: copy_field_description(Types::Iterations::CadenceType, :active)
argument :include_ancestor_groups, GraphQL::BOOLEAN_TYPE, required: false, argument :include_ancestor_groups, GraphQL::Types::Boolean, required: false,
description: 'Whether to include ancestor groups to search iterations cadences in.' description: 'Whether to include ancestor groups to search iterations cadences in.'
type ::Types::Iterations::CadenceType.connection_type, null: true type ::Types::Iterations::CadenceType.connection_type, null: true
......
...@@ -8,20 +8,20 @@ module Resolvers ...@@ -8,20 +8,20 @@ module Resolvers
argument :state, Types::IterationStateEnum, argument :state, Types::IterationStateEnum,
required: false, required: false,
description: 'Filter iterations by state.' description: 'Filter iterations by state.'
argument :title, GraphQL::STRING_TYPE, argument :title, GraphQL::Types::String,
required: false, required: false,
description: 'Fuzzy search by title.' description: 'Fuzzy search by title.'
# rubocop:disable Graphql/IDType # rubocop:disable Graphql/IDType
argument :id, GraphQL::ID_TYPE, argument :id, GraphQL::Types::ID,
required: false, required: false,
description: 'Global ID of the Iteration to look up.' description: 'Global ID of the Iteration to look up.'
# rubocop:enable Graphql/IDType # rubocop:enable Graphql/IDType
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::Types::ID,
required: false, required: false,
description: 'Internal ID of the Iteration to look up.' description: 'Internal ID of the Iteration to look up.'
argument :include_ancestors, GraphQL::BOOLEAN_TYPE, argument :include_ancestors, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Whether to include ancestor iterations. Defaults to true.' description: 'Whether to include ancestor iterations. Defaults to true.'
......
...@@ -6,15 +6,15 @@ module Resolvers ...@@ -6,15 +6,15 @@ module Resolvers
alias_method :pipeline, :object alias_method :pipeline, :object
argument :report_type, [GraphQL::STRING_TYPE], argument :report_type, [GraphQL::Types::String],
required: false, required: false,
description: 'Filter vulnerability findings by report type.' description: 'Filter vulnerability findings by report type.'
argument :severity, [GraphQL::STRING_TYPE], argument :severity, [GraphQL::Types::String],
required: false, required: false,
description: 'Filter vulnerability findings by severity.' description: 'Filter vulnerability findings by severity.'
argument :scanner, [GraphQL::STRING_TYPE], argument :scanner, [GraphQL::Types::String],
required: false, required: false,
description: 'Filter vulnerability findings by Scanner.externalId.' description: 'Filter vulnerability findings by Scanner.externalId.'
......
...@@ -8,11 +8,11 @@ module Resolvers ...@@ -8,11 +8,11 @@ module Resolvers
type ::Types::RequirementsManagement::RequirementType.connection_type, null: true type ::Types::RequirementsManagement::RequirementType.connection_type, null: true
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::Types::ID,
required: false, required: false,
description: 'IID of the requirement, e.g., "1".' description: 'IID of the requirement, e.g., "1".'
argument :iids, [GraphQL::ID_TYPE], argument :iids, [GraphQL::Types::ID],
required: false, required: false,
description: 'List of IIDs of requirements, e.g., `[1, 2]`.' description: 'List of IIDs of requirements, e.g., `[1, 2]`.'
......
...@@ -4,7 +4,7 @@ module Resolvers ...@@ -4,7 +4,7 @@ module Resolvers
class VulnerabilitiesGradeResolver < VulnerabilitiesBaseResolver class VulnerabilitiesGradeResolver < VulnerabilitiesBaseResolver
type [::Types::VulnerableProjectsByGradeType], null: true type [::Types::VulnerableProjectsByGradeType], null: true
argument :include_subgroups, GraphQL::BOOLEAN_TYPE, argument :include_subgroups, GraphQL::Types::Boolean,
required: false, required: false,
default_value: false, default_value: false,
description: 'Include grades belonging to subgroups.' description: 'Include grades belonging to subgroups.'
......
...@@ -6,7 +6,7 @@ module Resolvers ...@@ -6,7 +6,7 @@ module Resolvers
type Types::VulnerabilityType, null: true type Types::VulnerabilityType, null: true
argument :project_id, [GraphQL::ID_TYPE], argument :project_id, [GraphQL::Types::ID],
required: false, required: false,
description: 'Filter vulnerabilities by project.' description: 'Filter vulnerabilities by project.'
...@@ -22,7 +22,7 @@ module Resolvers ...@@ -22,7 +22,7 @@ module Resolvers
required: false, required: false,
description: 'Filter vulnerabilities by state.' description: 'Filter vulnerabilities by state.'
argument :scanner, [GraphQL::STRING_TYPE], argument :scanner, [GraphQL::Types::String],
required: false, required: false,
description: 'Filter vulnerabilities by VulnerabilityScanner.externalId.' description: 'Filter vulnerabilities by VulnerabilityScanner.externalId.'
...@@ -35,11 +35,11 @@ module Resolvers ...@@ -35,11 +35,11 @@ module Resolvers
default_value: 'severity_desc', default_value: 'severity_desc',
description: 'List vulnerabilities by sort order.' description: 'List vulnerabilities by sort order.'
argument :has_resolution, GraphQL::BOOLEAN_TYPE, argument :has_resolution, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Returns only the vulnerabilities which have been resolved on default branch.' description: 'Returns only the vulnerabilities which have been resolved on default branch.'
argument :has_issues, GraphQL::BOOLEAN_TYPE, argument :has_issues, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Returns only the vulnerabilities which have linked issues.' description: 'Returns only the vulnerabilities which have linked issues.'
......
...@@ -9,7 +9,7 @@ module Resolvers ...@@ -9,7 +9,7 @@ module Resolvers
authorize :read_security_resource authorize :read_security_resource
authorizes_object! authorizes_object!
argument :project_id, [GraphQL::ID_TYPE], argument :project_id, [GraphQL::Types::ID],
required: false, required: false,
description: 'Filter vulnerabilities by project.' description: 'Filter vulnerabilities by project.'
...@@ -25,7 +25,7 @@ module Resolvers ...@@ -25,7 +25,7 @@ module Resolvers
required: false, required: false,
description: 'Filter vulnerabilities by state.' description: 'Filter vulnerabilities by state.'
argument :scanner, [GraphQL::STRING_TYPE], argument :scanner, [GraphQL::Types::String],
required: false, required: false,
description: 'Filter vulnerabilities by scanner.' description: 'Filter vulnerabilities by scanner.'
...@@ -33,11 +33,11 @@ module Resolvers ...@@ -33,11 +33,11 @@ module Resolvers
required: false, required: false,
description: 'Filter vulnerabilities by scanner ID.' description: 'Filter vulnerabilities by scanner ID.'
argument :has_issues, GraphQL::BOOLEAN_TYPE, argument :has_issues, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Filter vulnerabilities that do or do not have issues.' description: 'Filter vulnerabilities that do or do not have issues.'
argument :has_resolution, GraphQL::BOOLEAN_TYPE, argument :has_resolution, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Filter vulnerabilities that do or do not have a resolution.' description: 'Filter vulnerabilities that do or do not have a resolution.'
......
...@@ -14,15 +14,15 @@ module Types ...@@ -14,15 +14,15 @@ module Types
description: 'Date when the license was last synced.', description: 'Date when the license was last synced.',
method: :last_synced_at method: :last_synced_at
field :billable_users_count, GraphQL::INT_TYPE, null: true, field :billable_users_count, GraphQL::Types::Int, null: true,
description: 'Number of billable users on the system.', description: 'Number of billable users on the system.',
method: :daily_billable_users_count method: :daily_billable_users_count
field :maximum_user_count, GraphQL::INT_TYPE, null: true, field :maximum_user_count, GraphQL::Types::Int, null: true,
description: 'Highest number of billable users on the system during the term of the current license.', description: 'Highest number of billable users on the system during the term of the current license.',
method: :maximum_user_count method: :maximum_user_count
field :users_over_license_count, GraphQL::INT_TYPE, null: true, field :users_over_license_count, GraphQL::Types::Int, null: true,
description: 'Number of users over the paid users in the license.' description: 'Number of users over the paid users in the license.'
def users_over_license_count def users_over_license_count
......
...@@ -7,26 +7,26 @@ module Types ...@@ -7,26 +7,26 @@ module Types
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: 'ID of the license.', description: 'ID of the license.',
method: :license_id method: :license_id
field :type, GraphQL::STRING_TYPE, null: false, field :type, GraphQL::Types::String, null: false,
description: 'Type of the license.', description: 'Type of the license.',
method: :license_type method: :license_type
field :plan, GraphQL::STRING_TYPE, null: false, field :plan, GraphQL::Types::String, null: false,
description: 'Name of the subscription plan.' description: 'Name of the subscription plan.'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'Name of the licensee.', description: 'Name of the licensee.',
method: :licensee_name method: :licensee_name
field :email, GraphQL::STRING_TYPE, null: true, field :email, GraphQL::Types::String, null: true,
description: 'Email of the licensee.', description: 'Email of the licensee.',
method: :licensee_email method: :licensee_email
field :company, GraphQL::STRING_TYPE, null: true, field :company, GraphQL::Types::String, null: true,
description: 'Company of the licensee.', description: 'Company of the licensee.',
method: :licensee_company method: :licensee_company
...@@ -42,7 +42,7 @@ module Types ...@@ -42,7 +42,7 @@ module Types
field :activated_at, ::Types::DateType, null: true, field :activated_at, ::Types::DateType, null: true,
description: 'Date when the license was activated.' description: 'Date when the license was activated.'
field :users_in_license_count, GraphQL::INT_TYPE, null: true, field :users_in_license_count, GraphQL::Types::Int, null: true,
description: 'Number of paid users in the license.', description: 'Number of paid users in the license.',
method: :restricted_user_count method: :restricted_user_count
end end
......
...@@ -17,7 +17,7 @@ module Types ...@@ -17,7 +17,7 @@ module Types
description: 'Path to value inside payload JSON.' description: 'Path to value inside payload JSON.'
argument :label, argument :label,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: 'Human-readable label of the payload path.' description: 'Human-readable label of the payload path.'
......
...@@ -9,13 +9,13 @@ module Types ...@@ -9,13 +9,13 @@ module Types
def self.coerce_input(value, ctx) def self.coerce_input(value, ctx)
return value if value.is_a?(::Integer) return value if value.is_a?(::Integer)
GraphQL::STRING_TYPE.coerce_input(value, ctx) GraphQL::Types::String.coerce_input(value, ctx)
end end
def self.coerce_result(value, ctx) def self.coerce_result(value, ctx)
return value if value.is_a?(::Integer) return value if value.is_a?(::Integer)
GraphQL::STRING_TYPE.coerce_result(value, ctx) GraphQL::Types::String.coerce_result(value, ctx)
end end
end end
end end
......
...@@ -14,7 +14,7 @@ module Types ...@@ -14,7 +14,7 @@ module Types
description: 'Path to value inside payload JSON.' description: 'Path to value inside payload JSON.'
field :label, field :label,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Human-readable label of the payload path.' description: 'Human-readable label of the payload path.'
......
...@@ -19,7 +19,7 @@ module Types ...@@ -19,7 +19,7 @@ module Types
description: 'Path to value inside payload JSON.' description: 'Path to value inside payload JSON.'
field :label, field :label,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Human-readable label of the payload path.' description: 'Human-readable label of the payload path.'
......
...@@ -8,7 +8,7 @@ module Types ...@@ -8,7 +8,7 @@ module Types
graphql_name 'DevopsAdoptionEnabledNamespace' graphql_name 'DevopsAdoptionEnabledNamespace'
description 'Enabled namespace for DevopsAdoption' description 'Enabled namespace for DevopsAdoption'
field :id, GraphQL::ID_TYPE, null: false, field :id, GraphQL::Types::ID, null: false,
description: "ID of the enabled namespace." description: "ID of the enabled namespace."
field :namespace, Types::NamespaceType, null: true, field :namespace, Types::NamespaceType, null: true,
......
...@@ -8,34 +8,34 @@ module Types ...@@ -8,34 +8,34 @@ module Types
graphql_name 'DevopsAdoptionSnapshot' graphql_name 'DevopsAdoptionSnapshot'
description 'Snapshot' description 'Snapshot'
field :issue_opened, GraphQL::BOOLEAN_TYPE, null: false, field :issue_opened, GraphQL::Types::Boolean, null: false,
description: 'At least one issue was opened.' description: 'At least one issue was opened.'
field :merge_request_opened, GraphQL::BOOLEAN_TYPE, null: false, field :merge_request_opened, GraphQL::Types::Boolean, null: false,
description: 'At least one merge request was opened.' description: 'At least one merge request was opened.'
field :merge_request_approved, GraphQL::BOOLEAN_TYPE, null: false, field :merge_request_approved, GraphQL::Types::Boolean, null: false,
description: 'At least one merge request was approved.' description: 'At least one merge request was approved.'
field :runner_configured, GraphQL::BOOLEAN_TYPE, null: false, field :runner_configured, GraphQL::Types::Boolean, null: false,
description: 'At least one runner was used.' description: 'At least one runner was used.'
field :pipeline_succeeded, GraphQL::BOOLEAN_TYPE, null: false, field :pipeline_succeeded, GraphQL::Types::Boolean, null: false,
description: 'At least one pipeline succeeded.' description: 'At least one pipeline succeeded.'
field :deploy_succeeded, GraphQL::BOOLEAN_TYPE, null: false, field :deploy_succeeded, GraphQL::Types::Boolean, null: false,
description: 'At least one deployment succeeded.' description: 'At least one deployment succeeded.'
field :security_scan_succeeded, GraphQL::BOOLEAN_TYPE, null: false, field :security_scan_succeeded, GraphQL::Types::Boolean, null: false,
description: 'At least one security scan succeeded.', description: 'At least one security scan succeeded.',
deprecated: { reason: 'Substituted with specific security metrics. Always false', milestone: '14.1' } deprecated: { reason: 'Substituted with specific security metrics. Always false', milestone: '14.1' }
field :code_owners_used_count, GraphQL::INT_TYPE, null: true, field :code_owners_used_count, GraphQL::Types::Int, null: true,
description: 'Total number of projects with existing CODEOWNERS file.' description: 'Total number of projects with existing CODEOWNERS file.'
field :sast_enabled_count, GraphQL::INT_TYPE, null: true, field :sast_enabled_count, GraphQL::Types::Int, null: true,
description: 'Total number of projects with enabled SAST.' description: 'Total number of projects with enabled SAST.'
field :dast_enabled_count, GraphQL::INT_TYPE, null: true, field :dast_enabled_count, GraphQL::Types::Int, null: true,
description: 'Total number of projects with enabled DAST.' description: 'Total number of projects with enabled DAST.'
field :dependency_scanning_enabled_count, GraphQL::INT_TYPE, null: true, field :dependency_scanning_enabled_count, GraphQL::Types::Int, null: true,
description: 'Total number of projects with enabled dependency scanning.' description: 'Total number of projects with enabled dependency scanning.'
field :coverage_fuzzing_enabled_count, GraphQL::INT_TYPE, null: true, field :coverage_fuzzing_enabled_count, GraphQL::Types::Int, null: true,
description: 'Total number of projects with enabled coverage fuzzing.' description: 'Total number of projects with enabled coverage fuzzing.'
field :vulnerability_management_used_count, GraphQL::INT_TYPE, null: true, field :vulnerability_management_used_count, GraphQL::Types::Int, null: true,
description: 'Total number of projects with vulnerability management used at least once.' description: 'Total number of projects with vulnerability management used at least once.'
field :total_projects_count, GraphQL::INT_TYPE, null: true, field :total_projects_count, GraphQL::Types::Int, null: true,
description: 'Total number of projects.' description: 'Total number of projects.'
field :recorded_at, Types::TimeType, null: false, field :recorded_at, Types::TimeType, null: false,
description: 'The time the snapshot was recorded.' description: 'The time the snapshot was recorded.'
......
...@@ -9,13 +9,13 @@ module Types ...@@ -9,13 +9,13 @@ module Types
graphql_name 'ApiFuzzingScanProfile' graphql_name 'ApiFuzzingScanProfile'
description 'An API Fuzzing scan profile.' description 'An API Fuzzing scan profile.'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'The unique name of the profile.' description: 'The unique name of the profile.'
field :description, GraphQL::STRING_TYPE, null: true, field :description, GraphQL::Types::String, null: true,
description: 'A short description of the profile.' description: 'A short description of the profile.'
field :yaml, GraphQL::STRING_TYPE, null: true, field :yaml, GraphQL::Types::String, null: true,
description: 'A syntax highlit HTML representation of the YAML.' description: 'A syntax highlit HTML representation of the YAML.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -12,7 +12,7 @@ module Types ...@@ -12,7 +12,7 @@ module Types
description: 'ID of the rule.' description: 'ID of the rule.'
field :name, field :name,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
null: true, null: true,
description: 'Name of the rule.' description: 'Name of the rule.'
......
...@@ -12,7 +12,7 @@ module Types ...@@ -12,7 +12,7 @@ module Types
required: false, required: false,
description: 'Negated epic arguments.' description: 'Negated epic arguments.'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query for epic title or description.' description: 'Search query for epic title or description.'
end end
......
...@@ -14,13 +14,13 @@ module Types ...@@ -14,13 +14,13 @@ module Types
field :id, type: ::Types::GlobalIDType[::Boards::EpicBoard], null: false, field :id, type: ::Types::GlobalIDType[::Boards::EpicBoard], null: false,
description: 'Global ID of the epic board.' description: 'Global ID of the epic board.'
field :name, type: GraphQL::STRING_TYPE, null: true, field :name, type: GraphQL::Types::String, null: true,
description: 'Name of the epic board.' description: 'Name of the epic board.'
field :hide_backlog_list, type: GraphQL::BOOLEAN_TYPE, null: true, field :hide_backlog_list, type: GraphQL::Types::Boolean, null: true,
description: 'Whether or not backlog list is hidden.' description: 'Whether or not backlog list is hidden.'
field :hide_closed_list, type: GraphQL::BOOLEAN_TYPE, null: true, field :hide_closed_list, type: GraphQL::Types::Boolean, null: true,
description: 'Whether or not closed list is hidden.' description: 'Whether or not closed list is hidden.'
field :labels, ::Types::LabelType.connection_type, null: true, field :labels, ::Types::LabelType.connection_type, null: true,
...@@ -33,10 +33,10 @@ module Types ...@@ -33,10 +33,10 @@ module Types
extras: [:lookahead], extras: [:lookahead],
resolver: Resolvers::Boards::EpicListsResolver resolver: Resolvers::Boards::EpicListsResolver
field :web_path, GraphQL::STRING_TYPE, null: false, field :web_path, GraphQL::Types::String, null: false,
description: 'Web path of the epic board.' description: 'Web path of the epic board.'
field :web_url, GraphQL::STRING_TYPE, null: false, field :web_url, GraphQL::Types::String, null: false,
description: 'Web URL of the epic board.' description: 'Web URL of the epic board.'
end end
end end
......
...@@ -16,26 +16,26 @@ module Types ...@@ -16,26 +16,26 @@ module Types
field :id, type: ::Types::GlobalIDType[::Boards::EpicList], null: false, field :id, type: ::Types::GlobalIDType[::Boards::EpicList], null: false,
description: 'Global ID of the board list.' description: 'Global ID of the board list.'
field :title, GraphQL::STRING_TYPE, null: false, field :title, GraphQL::Types::String, null: false,
description: 'Title of the list.' description: 'Title of the list.'
field :list_type, GraphQL::STRING_TYPE, null: false, field :list_type, GraphQL::Types::String, null: false,
description: 'Type of the list.' description: 'Type of the list.'
field :position, GraphQL::INT_TYPE, null: true, field :position, GraphQL::Types::Int, null: true,
description: 'Position of the list within the board.' description: 'Position of the list within the board.'
field :label, Types::LabelType, null: true, field :label, Types::LabelType, null: true,
description: 'Label of the list.' description: 'Label of the list.'
field :collapsed, GraphQL::BOOLEAN_TYPE, null: true, field :collapsed, GraphQL::Types::Boolean, null: true,
description: 'Indicates if this list is collapsed for this user.' description: 'Indicates if this list is collapsed for this user.'
field :epics, Types::EpicType.connection_type, null: true, field :epics, Types::EpicType.connection_type, null: true,
resolver: Resolvers::Boards::BoardListEpicsResolver, resolver: Resolvers::Boards::BoardListEpicsResolver,
description: 'List epics.' description: 'List epics.'
field :epics_count, GraphQL::INT_TYPE, null: true, field :epics_count, GraphQL::Types::Int, null: true,
description: 'Count of epics in the list.' description: 'Count of epics in the list.'
def collapsed def collapsed
......
...@@ -7,7 +7,7 @@ module Types ...@@ -7,7 +7,7 @@ module Types
graphql_name 'BoardEpicUserPreferences' graphql_name 'BoardEpicUserPreferences'
description 'Represents user preferences for a board epic' description 'Represents user preferences for a board epic'
field :collapsed, GraphQL::BOOLEAN_TYPE, null: false, field :collapsed, GraphQL::Types::Boolean, null: false,
description: 'Indicates epic should be displayed as collapsed.' description: 'Indicates epic should be displayed as collapsed.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -9,16 +9,16 @@ module Types ...@@ -9,16 +9,16 @@ module Types
field :date, GraphQL::Types::ISO8601Date, null: false, field :date, GraphQL::Types::ISO8601Date, null: false,
description: 'Date for burnup totals.' description: 'Date for burnup totals.'
field :scope_count, GraphQL::INT_TYPE, null: false, field :scope_count, GraphQL::Types::Int, null: false,
description: 'Number of issues as of this day.' description: 'Number of issues as of this day.'
field :scope_weight, GraphQL::INT_TYPE, null: false, field :scope_weight, GraphQL::Types::Int, null: false,
description: 'Total weight of issues as of this day.' description: 'Total weight of issues as of this day.'
field :completed_count, GraphQL::INT_TYPE, null: false, field :completed_count, GraphQL::Types::Int, null: false,
description: 'Number of closed issues as of this day.' description: 'Number of closed issues as of this day.'
field :completed_weight, GraphQL::INT_TYPE, null: false, field :completed_weight, GraphQL::Types::Int, null: false,
description: 'Total weight of closed issues as of this day.' description: 'Total weight of closed issues as of this day.'
end end
end end
...@@ -10,10 +10,10 @@ module Types ...@@ -10,10 +10,10 @@ module Types
field :average_coverage, GraphQL::FLOAT_TYPE, null: true, field :average_coverage, GraphQL::FLOAT_TYPE, null: true,
description: 'Average percentage of the different code coverage results available for the group.' description: 'Average percentage of the different code coverage results available for the group.'
field :coverage_count, GraphQL::INT_TYPE, null: true, field :coverage_count, GraphQL::Types::Int, null: true,
description: 'Number of different code coverage results available for the group.' description: 'Number of different code coverage results available for the group.'
field :project_count, GraphQL::INT_TYPE, null: true, field :project_count, GraphQL::Types::Int, null: true,
description: 'Number of projects with code coverage results for the group.' description: 'Number of projects with code coverage results for the group.'
field :date, Types::DateType, null: false, field :date, Types::DateType, null: false,
......
...@@ -10,7 +10,7 @@ module Types ...@@ -10,7 +10,7 @@ module Types
field :average_coverage, GraphQL::FLOAT_TYPE, null: true, field :average_coverage, GraphQL::FLOAT_TYPE, null: true,
description: 'Average percentage of the different code coverage results available for the project.' description: 'Average percentage of the different code coverage results available for the project.'
field :coverage_count, GraphQL::INT_TYPE, null: true, field :coverage_count, GraphQL::Types::Int, null: true,
description: 'Number of different code coverage results available.' description: 'Number of different code coverage results available.'
field :last_updated_on, Types::DateType, null: true, field :last_updated_on, Types::DateType, null: true,
......
...@@ -11,23 +11,23 @@ module Types ...@@ -11,23 +11,23 @@ module Types
alias_method :degradation, :object alias_method :degradation, :object
field :description, GraphQL::STRING_TYPE, null: false, field :description, GraphQL::Types::String, null: false,
description: "A description of the code quality degradation." description: "A description of the code quality degradation."
field :fingerprint, GraphQL::STRING_TYPE, null: false, field :fingerprint, GraphQL::Types::String, null: false,
description: 'A unique fingerprint to identify the code quality degradation. For example, an MD5 hash.' description: 'A unique fingerprint to identify the code quality degradation. For example, an MD5 hash.'
field :severity, Types::Ci::CodeQualityDegradationSeverityEnum, null: false, field :severity, Types::Ci::CodeQualityDegradationSeverityEnum, null: false,
description: "Status of the degradation (#{::Gitlab::Ci::Reports::CodequalityReports::SEVERITY_PRIORITIES.keys.map(&:upcase).join(', ')})." description: "Status of the degradation (#{::Gitlab::Ci::Reports::CodequalityReports::SEVERITY_PRIORITIES.keys.map(&:upcase).join(', ')})."
field :path, GraphQL::STRING_TYPE, null: false, field :path, GraphQL::Types::String, null: false,
description: 'The relative path to the file containing the code quality degradation.' description: 'The relative path to the file containing the code quality degradation.'
def path def path
degradation.dig(:location, :path) degradation.dig(:location, :path)
end end
field :line, GraphQL::INT_TYPE, null: false, field :line, GraphQL::Types::Int, null: false,
description: 'The line on which the code quality degradation occurred.' description: 'The line on which the code quality degradation occurred.'
def line def line
......
...@@ -25,7 +25,7 @@ module Types ...@@ -25,7 +25,7 @@ module Types
description: 'The user who created the token.' description: 'The user who created the token.'
field :description, field :description,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Description of the token.' description: 'Description of the token.'
...@@ -40,7 +40,7 @@ module Types ...@@ -40,7 +40,7 @@ module Types
description: 'Global ID of the token.' description: 'Global ID of the token.'
field :name, field :name,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Name given to the token.' description: 'Name given to the token.'
......
...@@ -19,12 +19,12 @@ module Types ...@@ -19,12 +19,12 @@ module Types
null: true, null: true,
description: 'User object, containing information about the person who created the agent.' description: 'User object, containing information about the person who created the agent.'
field :id, GraphQL::ID_TYPE, field :id, GraphQL::Types::ID,
null: false, null: false,
description: 'ID of the cluster agent.' description: 'ID of the cluster agent.'
field :name, field :name,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Name of the cluster agent.' description: 'Name of the cluster agent.'
...@@ -44,7 +44,7 @@ module Types ...@@ -44,7 +44,7 @@ module Types
description: 'Timestamp the cluster agent was updated.' description: 'Timestamp the cluster agent was updated.'
field :web_path, field :web_path,
GraphQL::STRING_TYPE, GraphQL::Types::String,
null: true, null: true,
description: 'Web path of the cluster agent.' description: 'Web path of the cluster agent.'
......
...@@ -6,22 +6,22 @@ module Types ...@@ -6,22 +6,22 @@ module Types
graphql_name 'ComplianceFrameworkInput' graphql_name 'ComplianceFrameworkInput'
argument :name, argument :name,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: 'New name for the compliance framework.' description: 'New name for the compliance framework.'
argument :description, argument :description,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: 'New description for the compliance framework.' description: 'New description for the compliance framework.'
argument :color, argument :color,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: 'New color representation of the compliance framework in hex format. e.g. #FCA121.' description: 'New color representation of the compliance framework in hex format. e.g. #FCA121.'
argument :pipeline_configuration_full_path, argument :pipeline_configuration_full_path,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: 'Full path of the compliance pipeline configuration stored in a project repository, such as `.gitlab/.compliance-gitlab-ci.yml@compliance/hipaa` **(ULTIMATE)**.' description: 'Full path of the compliance pipeline configuration stored in a project repository, such as `.gitlab/.compliance-gitlab-ci.yml@compliance/hipaa` **(ULTIMATE)**.'
end end
......
...@@ -7,23 +7,23 @@ module Types ...@@ -7,23 +7,23 @@ module Types
graphql_name 'ComplianceFramework' graphql_name 'ComplianceFramework'
description 'Represents a ComplianceFramework associated with a Project' description 'Represents a ComplianceFramework associated with a Project'
field :id, GraphQL::ID_TYPE, field :id, GraphQL::Types::ID,
null: false, null: false,
description: 'Compliance framework ID.' description: 'Compliance framework ID.'
field :name, GraphQL::STRING_TYPE, field :name, GraphQL::Types::String,
null: false, null: false,
description: 'Name of the compliance framework.' description: 'Name of the compliance framework.'
field :description, GraphQL::STRING_TYPE, field :description, GraphQL::Types::String,
null: false, null: false,
description: 'Description of the compliance framework.' description: 'Description of the compliance framework.'
field :color, GraphQL::STRING_TYPE, field :color, GraphQL::Types::String,
null: false, null: false,
description: 'Hexadecimal representation of compliance framework\'s label color.' description: 'Hexadecimal representation of compliance framework\'s label color.'
field :pipeline_configuration_full_path, GraphQL::STRING_TYPE, field :pipeline_configuration_full_path, GraphQL::Types::String,
null: true, null: true,
description: 'Full path of the compliance pipeline configuration stored in a project repository, such as `.gitlab/.compliance-gitlab-ci.yml@compliance/hipaa` **(ULTIMATE)**.', description: 'Full path of the compliance pipeline configuration stored in a project repository, such as `.gitlab/.compliance-gitlab-ci.yml@compliance/hipaa` **(ULTIMATE)**.',
authorize: :manage_group_level_compliance_pipeline_config authorize: :manage_group_level_compliance_pipeline_config
......
...@@ -8,11 +8,11 @@ module Types ...@@ -8,11 +8,11 @@ module Types
authorize :read_on_demand_scans authorize :read_on_demand_scans
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'The name of the branch.', description: 'The name of the branch.',
calls_gitaly: true calls_gitaly: true
field :exists, GraphQL::BOOLEAN_TYPE, null: true, field :exists, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether or not the branch exists.', description: 'Indicates whether or not the branch exists.',
calls_gitaly: true calls_gitaly: true
end end
......
...@@ -11,10 +11,10 @@ module Types ...@@ -11,10 +11,10 @@ module Types
field :id, ::Types::GlobalIDType[::Dast::Profile], null: false, field :id, ::Types::GlobalIDType[::Dast::Profile], null: false,
description: 'ID of the profile.' description: 'ID of the profile.'
field :name, GraphQL::STRING_TYPE, null: true, field :name, GraphQL::Types::String, null: true,
description: 'The name of the profile.' description: 'The name of the profile.'
field :description, GraphQL::STRING_TYPE, null: true, field :description, GraphQL::Types::String, null: true,
description: 'The description of the scan.' description: 'The description of the scan.'
field :dast_site_profile, DastSiteProfileType, null: true, field :dast_site_profile, DastSiteProfileType, null: true,
...@@ -27,7 +27,7 @@ module Types ...@@ -27,7 +27,7 @@ module Types
description: 'The associated branch.', description: 'The associated branch.',
calls_gitaly: true calls_gitaly: true
field :edit_path, GraphQL::STRING_TYPE, null: true, field :edit_path, GraphQL::Types::String, null: true,
description: 'Relative web path to the edit page of a profile.' description: 'Relative web path to the edit page of a profile.'
def edit_path def edit_path
......
...@@ -6,28 +6,28 @@ module Types ...@@ -6,28 +6,28 @@ module Types
graphql_name 'DastSiteProfileAuthInput' graphql_name 'DastSiteProfileAuthInput'
description 'Input type for DastSiteProfile authentication' description 'Input type for DastSiteProfile authentication'
argument :enabled, GraphQL::BOOLEAN_TYPE, argument :enabled, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Indicates whether authentication is enabled.' description: 'Indicates whether authentication is enabled.'
argument :url, GraphQL::STRING_TYPE, argument :url, GraphQL::Types::String,
required: false, required: false,
description: 'The URL of the page containing the sign-in HTML ' \ description: 'The URL of the page containing the sign-in HTML ' \
'form on the target website.' 'form on the target website.'
argument :username_field, GraphQL::STRING_TYPE, argument :username_field, GraphQL::Types::String,
required: false, required: false,
description: 'The name of username field at the sign-in HTML form.' description: 'The name of username field at the sign-in HTML form.'
argument :password_field, GraphQL::STRING_TYPE, argument :password_field, GraphQL::Types::String,
required: false, required: false,
description: 'The name of password field at the sign-in HTML form.' description: 'The name of password field at the sign-in HTML form.'
argument :username, GraphQL::STRING_TYPE, argument :username, GraphQL::Types::String,
required: false, required: false,
description: 'The username to authenticate with on the target website.' description: 'The username to authenticate with on the target website.'
argument :password, GraphQL::STRING_TYPE, argument :password, GraphQL::Types::String,
required: false, required: false,
description: 'The password to authenticate with on the target website.' description: 'The password to authenticate with on the target website.'
end end
......
...@@ -10,33 +10,33 @@ module Types ...@@ -10,33 +10,33 @@ module Types
authorize :read_on_demand_scans authorize :read_on_demand_scans
field :enabled, GraphQL::BOOLEAN_TYPE, field :enabled, GraphQL::Types::Boolean,
null: true, null: true,
method: :auth_enabled, method: :auth_enabled,
description: 'Indicates whether authentication is enabled.' description: 'Indicates whether authentication is enabled.'
field :url, GraphQL::STRING_TYPE, field :url, GraphQL::Types::String,
null: true, null: true,
method: :auth_url, method: :auth_url,
description: 'The URL of the page containing the sign-in HTML ' \ description: 'The URL of the page containing the sign-in HTML ' \
'form on the target website.' 'form on the target website.'
field :username_field, GraphQL::STRING_TYPE, field :username_field, GraphQL::Types::String,
null: true, null: true,
method: :auth_username_field, method: :auth_username_field,
description: 'The name of username field at the sign-in HTML form.' description: 'The name of username field at the sign-in HTML form.'
field :password_field, GraphQL::STRING_TYPE, field :password_field, GraphQL::Types::String,
null: true, null: true,
method: :auth_password_field, method: :auth_password_field,
description: 'The name of password field at the sign-in HTML form.' description: 'The name of password field at the sign-in HTML form.'
field :username, GraphQL::STRING_TYPE, field :username, GraphQL::Types::String,
null: true, null: true,
method: :auth_username, method: :auth_username,
description: 'The username to authenticate with on the target website.' description: 'The username to authenticate with on the target website.'
field :password, GraphQL::STRING_TYPE, field :password, GraphQL::Types::String,
null: true, null: true,
description: 'Redacted password to authenticate with on the target website.' description: 'Redacted password to authenticate with on the target website.'
end end
......
...@@ -10,32 +10,32 @@ module Types ...@@ -10,32 +10,32 @@ module Types
field :id, ::Types::GlobalIDType[::DastScannerProfile], null: false, field :id, ::Types::GlobalIDType[::DastScannerProfile], null: false,
description: 'ID of the DAST scanner profile.' description: 'ID of the DAST scanner profile.'
field :profile_name, GraphQL::STRING_TYPE, null: true, field :profile_name, GraphQL::Types::String, null: true,
description: 'Name of the DAST scanner profile.', description: 'Name of the DAST scanner profile.',
method: :name method: :name
field :spider_timeout, GraphQL::INT_TYPE, null: true, field :spider_timeout, GraphQL::Types::Int, null: true,
description: 'The maximum number of minutes allowed for the spider to traverse the site.' description: 'The maximum number of minutes allowed for the spider to traverse the site.'
field :target_timeout, GraphQL::INT_TYPE, null: true, field :target_timeout, GraphQL::Types::Int, null: true,
description: 'The maximum number of seconds allowed for the site under test to respond to a request.' description: 'The maximum number of seconds allowed for the site under test to respond to a request.'
field :scan_type, Types::DastScanTypeEnum, null: true, field :scan_type, Types::DastScanTypeEnum, null: true,
description: 'Indicates the type of DAST scan that will run. ' \ description: 'Indicates the type of DAST scan that will run. ' \
'Either a Passive Scan or an Active Scan.' 'Either a Passive Scan or an Active Scan.'
field :use_ajax_spider, GraphQL::BOOLEAN_TYPE, null: false, field :use_ajax_spider, GraphQL::Types::Boolean, null: false,
description: 'Indicates if the AJAX spider should be used to crawl the target site. ' \ description: 'Indicates if the AJAX spider should be used to crawl the target site. ' \
'True to run the AJAX spider in addition to the traditional spider, and false to run only the traditional spider.' 'True to run the AJAX spider in addition to the traditional spider, and false to run only the traditional spider.'
field :show_debug_messages, GraphQL::BOOLEAN_TYPE, null: false, field :show_debug_messages, GraphQL::Types::Boolean, null: false,
description: 'Indicates if debug messages should be included in DAST console output. ' \ description: 'Indicates if debug messages should be included in DAST console output. ' \
'True to include the debug messages.' 'True to include the debug messages.'
field :edit_path, GraphQL::STRING_TYPE, null: true, field :edit_path, GraphQL::Types::String, null: true,
description: 'Relative web path to the edit page of a scanner profile.' description: 'Relative web path to the edit page of a scanner profile.'
field :referenced_in_security_policies, [GraphQL::STRING_TYPE], null: true, field :referenced_in_security_policies, [GraphQL::Types::String], null: true,
calls_gitaly: true, calls_gitaly: true,
description: 'List of security policy names that are referencing given project.' description: 'List of security policy names that are referencing given project.'
......
...@@ -16,26 +16,26 @@ module Types ...@@ -16,26 +16,26 @@ module Types
field :id, ::Types::GlobalIDType[::DastSiteProfile], null: false, field :id, ::Types::GlobalIDType[::DastSiteProfile], null: false,
description: 'ID of the site profile.' description: 'ID of the site profile.'
field :profile_name, GraphQL::STRING_TYPE, null: true, field :profile_name, GraphQL::Types::String, null: true,
description: 'The name of the site profile.', description: 'The name of the site profile.',
method: :name method: :name
field :target_url, GraphQL::STRING_TYPE, null: true, field :target_url, GraphQL::Types::String, null: true,
description: 'The URL of the target to be scanned.' description: 'The URL of the target to be scanned.'
field :target_type, Types::DastTargetTypeEnum, null: true, field :target_type, Types::DastTargetTypeEnum, null: true,
description: 'The type of target to be scanned.' description: 'The type of target to be scanned.'
field :edit_path, GraphQL::STRING_TYPE, null: true, field :edit_path, GraphQL::Types::String, null: true,
description: 'Relative web path to the edit page of a site profile.' description: 'Relative web path to the edit page of a site profile.'
field :auth, Types::Dast::SiteProfileAuthType, null: true, field :auth, Types::Dast::SiteProfileAuthType, null: true,
description: 'Target authentication details.' description: 'Target authentication details.'
field :excluded_urls, [GraphQL::STRING_TYPE], null: true, field :excluded_urls, [GraphQL::Types::String], null: true,
description: 'The URLs to skip during an authenticated scan.' description: 'The URLs to skip during an authenticated scan.'
field :request_headers, GraphQL::STRING_TYPE, null: true, field :request_headers, GraphQL::Types::String, null: true,
description: 'Comma-separated list of request header names and values to be ' \ description: 'Comma-separated list of request header names and values to be ' \
'added to every request made by DAST.' 'added to every request made by DAST.'
...@@ -43,10 +43,10 @@ module Types ...@@ -43,10 +43,10 @@ module Types
description: 'The current validation status of the site profile.', description: 'The current validation status of the site profile.',
method: :status method: :status
field :normalized_target_url, GraphQL::STRING_TYPE, null: true, field :normalized_target_url, GraphQL::Types::String, null: true,
description: 'Normalized URL of the target to be scanned.' description: 'Normalized URL of the target to be scanned.'
field :referenced_in_security_policies, [GraphQL::STRING_TYPE], null: true, field :referenced_in_security_policies, [GraphQL::Types::String], null: true,
calls_gitaly: true, calls_gitaly: true,
description: 'List of security policy names that are referencing given project.' description: 'List of security policy names that are referencing given project.'
......
...@@ -14,7 +14,7 @@ module Types ...@@ -14,7 +14,7 @@ module Types
description: 'Status of the site validation.', description: 'Status of the site validation.',
method: :state method: :state
field :normalized_target_url, GraphQL::STRING_TYPE, null: true, field :normalized_target_url, GraphQL::Types::String, null: true,
description: 'Normalized URL of the target to be validated.' description: 'Normalized URL of the target to be validated.'
def normalized_target_url def normalized_target_url
......
...@@ -5,9 +5,9 @@ module Types ...@@ -5,9 +5,9 @@ module Types
class DoraMetricType < BaseObject class DoraMetricType < BaseObject
graphql_name 'DoraMetric' graphql_name 'DoraMetric'
field :date, GraphQL::STRING_TYPE, null: true, field :date, GraphQL::Types::String, null: true,
description: 'Date of the data point.' description: 'Date of the data point.'
field :value, GraphQL::INT_TYPE, null: true, field :value, GraphQL::Types::Int, null: true,
description: 'Value of the data point.' description: 'Value of the data point.'
end end
# rubocop: enable Graphql/AuthorizeTypes # rubocop: enable Graphql/AuthorizeTypes
......
...@@ -72,7 +72,8 @@ RSpec.describe Resolvers::Clusters::AgentsResolver.single do ...@@ -72,7 +72,8 @@ RSpec.describe Resolvers::Clusters::AgentsResolver.single do
it do it do
expect(subject).to be_present expect(subject).to be_present
expect(subject.type.to_s).to eq('String!') expect(subject.type).to be_kind_of GraphQL::Schema::NonNull
expect(subject.type.unwrap).to eq GraphQL::Types::String
expect(subject.description).to be_present expect(subject.description).to be_present
end end
end end
......
...@@ -37,7 +37,7 @@ RSpec.describe Resolvers::EpicsResolver do ...@@ -37,7 +37,7 @@ RSpec.describe Resolvers::EpicsResolver do
end end
it 'does not inflate the complexity' do it 'does not inflate the complexity' do
field = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: described_class, null: false, max_page_size: 100) field = Types::BaseField.new(name: 'test', type: GraphQL::Types::String, resolver_class: described_class, null: false, max_page_size: 100)
expect(field.to_graphql.complexity.call({}, { iid: [epic1.iid] }, 5)).to eq 6 expect(field.to_graphql.complexity.call({}, { iid: [epic1.iid] }, 5)).to eq 6
end end
...@@ -54,7 +54,7 @@ RSpec.describe Resolvers::EpicsResolver do ...@@ -54,7 +54,7 @@ RSpec.describe Resolvers::EpicsResolver do
end end
it 'increases the complexity based on child_complexity and number of iids' do it 'increases the complexity based on child_complexity and number of iids' do
field = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: described_class, null: false, max_page_size: 100) field = Types::BaseField.new(name: 'test', type: GraphQL::Types::String, resolver_class: described_class, null: false, max_page_size: 100)
expect(field.to_graphql.complexity.call({}, { iids: [epic1.iid] }, 5)).to eq 6 expect(field.to_graphql.complexity.call({}, { iids: [epic1.iid] }, 5)).to eq 6
expect(field.to_graphql.complexity.call({}, { iids: [epic1.iid, epic2.iid] }, 5)).to eq 11 expect(field.to_graphql.complexity.call({}, { iids: [epic1.iid, epic2.iid] }, 5)).to eq 11
......
...@@ -10,12 +10,12 @@ RSpec.describe Types::DoraMetricType do ...@@ -10,12 +10,12 @@ RSpec.describe Types::DoraMetricType do
describe 'date field' do describe 'date field' do
subject { described_class.fields['date'] } subject { described_class.fields['date'] }
it { is_expected.to have_graphql_type(GraphQL::STRING_TYPE) } it { is_expected.to have_graphql_type(GraphQL::Types::String) }
end end
describe 'value field' do describe 'value field' do
subject { described_class.fields['value'] } subject { described_class.fields['value'] }
it { is_expected.to have_graphql_type(GraphQL::INT_TYPE) } it { is_expected.to have_graphql_type(GraphQL::Types::Int) }
end end
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