Commit e387173f authored by Robert May's avatar Robert May

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

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

See merge request gitlab-org/gitlab!66463
parents 4393828e dad47460
...@@ -90,45 +90,6 @@ Graphql/OldTypes: ...@@ -90,45 +90,6 @@ Graphql/OldTypes:
- 'app/graphql/mutations/snippets/create.rb' - 'app/graphql/mutations/snippets/create.rb'
- 'app/graphql/mutations/snippets/update.rb' - 'app/graphql/mutations/snippets/update.rb'
- 'app/graphql/mutations/user_callouts/create.rb' - 'app/graphql/mutations/user_callouts/create.rb'
- 'app/graphql/resolvers/alert_management/alert_resolver.rb'
- 'app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb'
- 'app/graphql/resolvers/blobs_resolver.rb'
- 'app/graphql/resolvers/ci/config_resolver.rb'
- 'app/graphql/resolvers/ci/runners_resolver.rb'
- 'app/graphql/resolvers/ci/template_resolver.rb'
- 'app/graphql/resolvers/concerns/group_issuable_resolver.rb'
- 'app/graphql/resolvers/concerns/issue_resolver_arguments.rb'
- 'app/graphql/resolvers/concerns/resolves_pipelines.rb'
- 'app/graphql/resolvers/container_repositories_resolver.rb'
- 'app/graphql/resolvers/design_management/design_resolver.rb'
- 'app/graphql/resolvers/design_management/version/design_at_version_resolver.rb'
- 'app/graphql/resolvers/design_management/version_in_collection_resolver.rb'
- 'app/graphql/resolvers/design_management/versions_resolver.rb'
- 'app/graphql/resolvers/environments_resolver.rb'
- 'app/graphql/resolvers/full_path_resolver.rb'
- 'app/graphql/resolvers/group_labels_resolver.rb'
- 'app/graphql/resolvers/group_milestones_resolver.rb'
- 'app/graphql/resolvers/labels_resolver.rb'
- 'app/graphql/resolvers/members_resolver.rb'
- 'app/graphql/resolvers/merge_request_resolver.rb'
- 'app/graphql/resolvers/merge_requests_resolver.rb'
- 'app/graphql/resolvers/metrics/dashboard_resolver.rb'
- 'app/graphql/resolvers/milestones_resolver.rb'
- 'app/graphql/resolvers/namespace_projects_resolver.rb'
- 'app/graphql/resolvers/packages_base_resolver.rb'
- 'app/graphql/resolvers/project_milestones_resolver.rb'
- 'app/graphql/resolvers/project_pipeline_resolver.rb'
- 'app/graphql/resolvers/projects/jira_projects_resolver.rb'
- 'app/graphql/resolvers/projects/services_resolver.rb'
- 'app/graphql/resolvers/projects_resolver.rb'
- 'app/graphql/resolvers/release_resolver.rb'
- 'app/graphql/resolvers/repository_branch_names_resolver.rb'
- 'app/graphql/resolvers/snippets_resolver.rb'
- 'app/graphql/resolvers/terraform/states_resolver.rb'
- 'app/graphql/resolvers/tree_resolver.rb'
- 'app/graphql/resolvers/user_resolver.rb'
- 'app/graphql/resolvers/user_starred_projects_resolver.rb'
- 'app/graphql/resolvers/users_resolver.rb'
- 'app/graphql/types/access_level_type.rb' - 'app/graphql/types/access_level_type.rb'
- 'app/graphql/types/admin/analytics/usage_trends/measurement_type.rb' - 'app/graphql/types/admin/analytics/usage_trends/measurement_type.rb'
- 'app/graphql/types/admin/sidekiq_queues/delete_jobs_response_type.rb' - 'app/graphql/types/admin/sidekiq_queues/delete_jobs_response_type.rb'
......
...@@ -5,7 +5,7 @@ module Resolvers ...@@ -5,7 +5,7 @@ module Resolvers
class AlertResolver < BaseResolver class AlertResolver < BaseResolver
include LooksAhead include LooksAhead
argument :iid, GraphQL::STRING_TYPE, argument :iid, GraphQL::Types::String,
required: false, required: false,
description: 'IID of the alert. For example, "1".' description: 'IID of the alert. For example, "1".'
...@@ -23,11 +23,11 @@ module Resolvers ...@@ -23,11 +23,11 @@ module Resolvers
required: true, required: true,
default_value: 'operations' default_value: 'operations'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
description: 'Search query for title, description, service, or monitoring_tool.', description: 'Search query for title, description, service, or monitoring_tool.',
required: false required: false
argument :assignee_username, GraphQL::STRING_TYPE, argument :assignee_username, GraphQL::Types::String,
required: false, required: false,
description: 'Username of a user assigned to the issue.' description: 'Username of a user assigned to the issue.'
......
...@@ -5,11 +5,11 @@ module Resolvers ...@@ -5,11 +5,11 @@ module Resolvers
class AlertStatusCountsResolver < BaseResolver class AlertStatusCountsResolver < BaseResolver
type Types::AlertManagement::AlertStatusCountsType, null: true type Types::AlertManagement::AlertStatusCountsType, null: true
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
description: 'Search query for title, description, service, or monitoring_tool.', description: 'Search query for title, description, service, or monitoring_tool.',
required: false required: false
argument :assignee_username, GraphQL::STRING_TYPE, argument :assignee_username, GraphQL::Types::String,
required: false, required: false,
description: 'Username of a user assigned to the issue.' description: 'Username of a user assigned to the issue.'
......
...@@ -10,10 +10,10 @@ module Resolvers ...@@ -10,10 +10,10 @@ module Resolvers
alias_method :repository, :object alias_method :repository, :object
argument :paths, [GraphQL::STRING_TYPE], argument :paths, [GraphQL::Types::String],
required: true, required: true,
description: 'Array of desired blob paths.' description: 'Array of desired blob paths.'
argument :ref, GraphQL::STRING_TYPE, argument :ref, GraphQL::Types::String,
required: false, required: false,
default_value: nil, default_value: nil,
description: 'The commit ref to get the blobs from. Default value is HEAD.' description: 'The commit ref to get the blobs from. Default value is HEAD.'
......
...@@ -14,19 +14,19 @@ module Resolvers ...@@ -14,19 +14,19 @@ module Resolvers
authorize :read_pipeline authorize :read_pipeline
argument :project_path, GraphQL::ID_TYPE, argument :project_path, GraphQL::Types::ID,
required: true, required: true,
description: 'The project of the CI config.' description: 'The project of the CI config.'
argument :sha, GraphQL::STRING_TYPE, argument :sha, GraphQL::Types::String,
required: false, required: false,
description: "Sha for the pipeline." description: "Sha for the pipeline."
argument :content, GraphQL::STRING_TYPE, argument :content, GraphQL::Types::String,
required: true, required: true,
description: "Contents of `.gitlab-ci.yml`." description: "Contents of `.gitlab-ci.yml`."
argument :dry_run, GraphQL::BOOLEAN_TYPE, argument :dry_run, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Run pipeline creation simulation, or only do static check.' description: 'Run pipeline creation simulation, or only do static check.'
......
...@@ -9,12 +9,12 @@ module Resolvers ...@@ -9,12 +9,12 @@ module Resolvers
description 'Runner setup instructions.' description 'Runner setup instructions.'
argument :platform, argument :platform,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
required: true, required: true,
description: 'Platform to generate the instructions for.' description: 'Platform to generate the instructions for.'
argument :architecture, argument :architecture,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
required: true, required: true,
description: 'Architecture to generate the instructions for.' description: 'Architecture to generate the instructions for.'
......
...@@ -15,11 +15,11 @@ module Resolvers ...@@ -15,11 +15,11 @@ module Resolvers
required: false, required: false,
description: 'Filter runners by type.' description: 'Filter runners by type.'
argument :tag_list, [GraphQL::STRING_TYPE], argument :tag_list, [GraphQL::Types::String],
required: false, required: false,
description: 'Filter by tags associated with the runner (comma-separated or array).' description: 'Filter by tags associated with the runner (comma-separated or array).'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Filter by full token or partial text in description field.' description: 'Filter by full token or partial text in description field.'
......
...@@ -5,7 +5,7 @@ module Resolvers ...@@ -5,7 +5,7 @@ module Resolvers
class TemplateResolver < BaseResolver class TemplateResolver < BaseResolver
type Types::Ci::TemplateType, null: true type Types::Ci::TemplateType, null: true
argument :name, GraphQL::STRING_TYPE, required: true, argument :name, GraphQL::Types::String, required: true,
description: 'Name of the CI/CD template to search for. Template must be formatted as `Name.gitlab-ci.yml`.' description: 'Name of the CI/CD template to search for. Template must be formatted as `Name.gitlab-ci.yml`.'
alias_method :project, :object alias_method :project, :object
......
...@@ -11,7 +11,7 @@ module Resolvers ...@@ -11,7 +11,7 @@ module Resolvers
alias_method :pipeline, :object alias_method :pipeline, :object
argument :build_ids, [GraphQL::ID_TYPE], argument :build_ids, [GraphQL::Types::ID],
required: true, required: true,
description: 'IDs of the builds used to run the test suite.' description: 'IDs of the builds used to run the test suite.'
......
...@@ -5,7 +5,7 @@ module GroupIssuableResolver ...@@ -5,7 +5,7 @@ module GroupIssuableResolver
class_methods do class_methods do
def include_subgroups(name_of_things) def include_subgroups(name_of_things)
argument :include_subgroups, GraphQL::BOOLEAN_TYPE, argument :include_subgroups, GraphQL::Types::Boolean,
required: false, required: false,
default_value: false, default_value: false,
description: "Include #{name_of_things} belonging to subgroups" description: "Include #{name_of_things} belonging to subgroups"
......
...@@ -6,29 +6,29 @@ module IssueResolverArguments ...@@ -6,29 +6,29 @@ module IssueResolverArguments
prepended do prepended do
include LooksAhead include LooksAhead
argument :iid, GraphQL::STRING_TYPE, argument :iid, GraphQL::Types::String,
required: false, required: false,
description: 'IID of the issue. For example, "1".' description: 'IID of the issue. For example, "1".'
argument :iids, [GraphQL::STRING_TYPE], argument :iids, [GraphQL::Types::String],
required: false, required: false,
description: 'List of IIDs of issues. For example, `["1", "2"]`.' description: 'List of IIDs of issues. For example, `["1", "2"]`.'
argument :label_name, [GraphQL::STRING_TYPE, null: true], argument :label_name, [GraphQL::Types::String, null: true],
required: false, required: false,
description: 'Labels applied to this issue.' description: 'Labels applied to this issue.'
argument :milestone_title, [GraphQL::STRING_TYPE, null: true], argument :milestone_title, [GraphQL::Types::String, null: true],
required: false, required: false,
description: 'Milestone applied to this issue.' description: 'Milestone applied to this issue.'
argument :author_username, GraphQL::STRING_TYPE, argument :author_username, GraphQL::Types::String,
required: false, required: false,
description: 'Username of the author of the issue.' description: 'Username of the author of the issue.'
argument :assignee_username, GraphQL::STRING_TYPE, argument :assignee_username, GraphQL::Types::String,
required: false, required: false,
description: 'Username of a user assigned to the issue.', description: 'Username of a user assigned to the issue.',
deprecated: { reason: 'Use `assigneeUsernames`', milestone: '13.11' } deprecated: { reason: 'Use `assigneeUsernames`', milestone: '13.11' }
argument :assignee_usernames, [GraphQL::STRING_TYPE], argument :assignee_usernames, [GraphQL::Types::String],
required: false, required: false,
description: 'Usernames of users assigned to the issue.' description: 'Usernames of users assigned to the issue.'
argument :assignee_id, GraphQL::STRING_TYPE, argument :assignee_id, GraphQL::Types::String,
required: false, required: false,
description: 'ID of a user assigned to the issues, "none" and "any" values are supported.' description: 'ID of a user assigned to the issues, "none" and "any" values are supported.'
argument :created_before, Types::TimeType, argument :created_before, Types::TimeType,
...@@ -49,7 +49,7 @@ module IssueResolverArguments ...@@ -49,7 +49,7 @@ module IssueResolverArguments
argument :closed_after, Types::TimeType, argument :closed_after, Types::TimeType,
required: false, required: false,
description: 'Issues closed after this date.' description: 'Issues closed after this date.'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query for issue title or description.' description: 'Search query for issue title or description.'
argument :types, [Types::IssueTypeEnum], argument :types, [Types::IssueTypeEnum],
......
...@@ -10,11 +10,11 @@ module ResolvesPipelines ...@@ -10,11 +10,11 @@ module ResolvesPipelines
required: false, required: false,
description: "Filter pipelines by their status." description: "Filter pipelines by their status."
argument :ref, argument :ref,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: "Filter pipelines by the ref they are run for." description: "Filter pipelines by the ref they are run for."
argument :sha, argument :sha,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: "Filter pipelines by the sha of the commit they are run for." description: "Filter pipelines by the sha of the commit they are run for."
end end
......
...@@ -6,7 +6,7 @@ module Resolvers ...@@ -6,7 +6,7 @@ module Resolvers
type Types::ContainerRepositoryType, null: true type Types::ContainerRepositoryType, null: true
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::Types::String,
required: false, required: false,
description: 'Filter the container repositories by their name.' description: 'Filter the container repositories by their name.'
......
...@@ -11,7 +11,7 @@ module Resolvers ...@@ -11,7 +11,7 @@ module Resolvers
required: false, required: false,
description: 'Find a design by its ID.' description: 'Find a design by its ID.'
argument :filename, GraphQL::STRING_TYPE, argument :filename, GraphQL::Types::String,
required: false, required: false,
description: 'Find a design by its filename.' description: 'Find a design by its filename.'
......
...@@ -11,7 +11,7 @@ module Resolvers ...@@ -11,7 +11,7 @@ module Resolvers
argument :ids, [DesignID], argument :ids, [DesignID],
required: false, required: false,
description: 'Filters designs by their ID.' description: 'Filters designs by their ID.'
argument :filenames, [GraphQL::STRING_TYPE], argument :filenames, [GraphQL::Types::String],
required: false, required: false,
description: 'Filters designs by their filename.' description: 'Filters designs by their filename.'
argument :at_version, VersionID, argument :at_version, VersionID,
......
...@@ -23,7 +23,7 @@ module Resolvers ...@@ -23,7 +23,7 @@ module Resolvers
argument :design_id, DesignID, argument :design_id, DesignID,
required: false, required: false,
description: 'The ID of a specific design.' description: 'The ID of a specific design.'
argument :filename, GraphQL::STRING_TYPE, argument :filename, GraphQL::Types::String,
required: false, required: false,
description: 'The filename of a specific design.' description: 'The filename of a specific design.'
......
...@@ -17,7 +17,7 @@ module Resolvers ...@@ -17,7 +17,7 @@ module Resolvers
required: false, required: false,
description: 'Filters designs by their ID.' description: 'Filters designs by their ID.'
argument :filenames, argument :filenames,
[GraphQL::STRING_TYPE], [GraphQL::Types::String],
required: false, required: false,
description: 'Filters designs by their filename.' description: 'Filters designs by their filename.'
......
...@@ -15,7 +15,7 @@ module Resolvers ...@@ -15,7 +15,7 @@ module Resolvers
VersionID = ::Types::GlobalIDType[::DesignManagement::Version] VersionID = ::Types::GlobalIDType[::DesignManagement::Version]
argument :sha, GraphQL::STRING_TYPE, argument :sha, GraphQL::Types::String,
required: false, required: false,
description: "The SHA256 of a specific version." description: "The SHA256 of a specific version."
argument :id, VersionID, argument :id, VersionID,
......
...@@ -11,7 +11,7 @@ module Resolvers ...@@ -11,7 +11,7 @@ module Resolvers
extras [:parent] extras [:parent]
argument :earlier_or_equal_to_sha, GraphQL::STRING_TYPE, argument :earlier_or_equal_to_sha, GraphQL::Types::String,
as: :sha, as: :sha,
required: false, required: false,
description: 'The SHA256 of the most recent acceptable version.' description: 'The SHA256 of the most recent acceptable version.'
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
module Resolvers module Resolvers
class EchoResolver < BaseResolver class EchoResolver < BaseResolver
type ::GraphQL::STRING_TYPE, null: false type ::GraphQL::Types::String, null: false
description 'Testing endpoint to validate the API with' description 'Testing endpoint to validate the API with'
argument :text, argument :text,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
required: true, required: true,
description: 'Text to echo back.' description: 'Text to echo back.'
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
module Resolvers module Resolvers
class EnvironmentsResolver < BaseResolver class EnvironmentsResolver < BaseResolver
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::Types::String,
required: false, required: false,
description: 'Name of the environment.' description: 'Name of the environment.'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query for environment name.' description: 'Search query for environment name.'
argument :states, [GraphQL::STRING_TYPE], argument :states, [GraphQL::Types::String],
required: false, required: false,
description: 'States of environments that should be included in result.' description: 'States of environments that should be included in result.'
......
...@@ -6,12 +6,12 @@ module Resolvers ...@@ -6,12 +6,12 @@ module Resolvers
type Types::ErrorTracking::SentryErrorType.connection_type, null: true type Types::ErrorTracking::SentryErrorType.connection_type, null: true
extension Gitlab::Graphql::Extensions::ExternallyPaginatedArrayExtension extension Gitlab::Graphql::Extensions::ExternallyPaginatedArrayExtension
argument :search_term, ::GraphQL::STRING_TYPE, argument :search_term, ::GraphQL::Types::String,
description: 'Search query for the Sentry error details.', description: 'Search query for the Sentry error details.',
required: false required: false
# TODO: convert to Enum # TODO: convert to Enum
argument :sort, ::GraphQL::STRING_TYPE, argument :sort, ::GraphQL::Types::String,
description: 'Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default.', description: 'Attribute to sort on. Options are frequency, first_seen, last_seen. last_seen is default.',
required: false required: false
......
...@@ -5,7 +5,7 @@ module Resolvers ...@@ -5,7 +5,7 @@ module Resolvers
extend ActiveSupport::Concern extend ActiveSupport::Concern
prepended do prepended do
argument :full_path, GraphQL::ID_TYPE, argument :full_path, GraphQL::Types::ID,
required: true, required: true,
description: 'The full path of the project, group or namespace, e.g., `gitlab-org/gitlab-foss`.' description: 'The full path of the project, group or namespace, e.g., `gitlab-org/gitlab-foss`.'
end end
......
...@@ -4,12 +4,12 @@ module Resolvers ...@@ -4,12 +4,12 @@ module Resolvers
class GroupLabelsResolver < LabelsResolver class GroupLabelsResolver < LabelsResolver
type Types::LabelType.connection_type, null: true type Types::LabelType.connection_type, null: true
argument :include_descendant_groups, GraphQL::BOOLEAN_TYPE, argument :include_descendant_groups, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include labels from descendant groups.', description: 'Include labels from descendant groups.',
default_value: false default_value: false
argument :only_group_labels, GraphQL::BOOLEAN_TYPE, argument :only_group_labels, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include only group level labels.', description: 'Include only group level labels.',
default_value: false default_value: false
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
module Resolvers module Resolvers
class GroupMilestonesResolver < MilestonesResolver class GroupMilestonesResolver < MilestonesResolver
argument :include_descendants, GraphQL::BOOLEAN_TYPE, argument :include_descendants, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include milestones from all subgroups and subprojects.' description: 'Include milestones from all subgroups and subprojects.'
argument :include_ancestors, GraphQL::BOOLEAN_TYPE, argument :include_ancestors, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include milestones from all parent groups.' description: 'Include milestones from all parent groups.'
......
...@@ -8,11 +8,11 @@ module Resolvers ...@@ -8,11 +8,11 @@ module Resolvers
type Types::LabelType.connection_type, null: true type Types::LabelType.connection_type, null: true
argument :search_term, GraphQL::STRING_TYPE, argument :search_term, GraphQL::Types::String,
required: false, required: false,
description: 'A search term to find labels with.' description: 'A search term to find labels with.'
argument :include_ancestor_groups, GraphQL::BOOLEAN_TYPE, argument :include_ancestor_groups, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include labels from ancestor groups.', description: 'Include labels from ancestor groups.',
default_value: false default_value: false
......
...@@ -7,7 +7,7 @@ module Resolvers ...@@ -7,7 +7,7 @@ module Resolvers
type Types::MemberInterface.connection_type, null: true type Types::MemberInterface.connection_type, null: true
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query.' description: 'Search query.'
......
...@@ -8,7 +8,7 @@ module Resolvers ...@@ -8,7 +8,7 @@ module Resolvers
type ::Types::MergeRequestType, null: true type ::Types::MergeRequestType, null: true
argument :iid, GraphQL::STRING_TYPE, argument :iid, GraphQL::Types::String,
required: true, required: true,
as: :iids, as: :iids,
description: 'IID of the merge request, for example `1`.' description: 'IID of the merge request, for example `1`.'
......
...@@ -10,28 +10,28 @@ module Resolvers ...@@ -10,28 +10,28 @@ module Resolvers
alias_method :project, :object alias_method :project, :object
def self.accept_assignee def self.accept_assignee
argument :assignee_username, GraphQL::STRING_TYPE, argument :assignee_username, GraphQL::Types::String,
required: false, required: false,
description: 'Username of the assignee.' description: 'Username of the assignee.'
end end
def self.accept_author def self.accept_author
argument :author_username, GraphQL::STRING_TYPE, argument :author_username, GraphQL::Types::String,
required: false, required: false,
description: 'Username of the author.' description: 'Username of the author.'
end end
def self.accept_reviewer def self.accept_reviewer
argument :reviewer_username, GraphQL::STRING_TYPE, argument :reviewer_username, GraphQL::Types::String,
required: false, required: false,
description: 'Username of the reviewer.' description: 'Username of the reviewer.'
end end
argument :iids, [GraphQL::STRING_TYPE], argument :iids, [GraphQL::Types::String],
required: false, required: false,
description: 'Array of IIDs of merge requests, for example `[1, 2]`.' description: 'Array of IIDs of merge requests, for example `[1, 2]`.'
argument :source_branches, [GraphQL::STRING_TYPE], argument :source_branches, [GraphQL::Types::String],
required: false, required: false,
as: :source_branch, as: :source_branch,
description: <<~DESC description: <<~DESC
...@@ -39,7 +39,7 @@ module Resolvers ...@@ -39,7 +39,7 @@ module Resolvers
All resolved merge requests will have one of these branches as their source. All resolved merge requests will have one of these branches as their source.
DESC DESC
argument :target_branches, [GraphQL::STRING_TYPE], argument :target_branches, [GraphQL::Types::String],
required: false, required: false,
as: :target_branch, as: :target_branch,
description: <<~DESC description: <<~DESC
...@@ -51,7 +51,7 @@ module Resolvers ...@@ -51,7 +51,7 @@ module Resolvers
required: false, required: false,
description: 'A merge request state. If provided, all resolved merge requests will have this state.' description: 'A merge request state. If provided, all resolved merge requests will have this state.'
argument :labels, [GraphQL::STRING_TYPE], argument :labels, [GraphQL::Types::String],
required: false, required: false,
as: :label_name, as: :label_name,
description: 'Array of label names. All resolved merge requests will have all of these labels.' description: 'Array of label names. All resolved merge requests will have all of these labels.'
...@@ -61,7 +61,7 @@ module Resolvers ...@@ -61,7 +61,7 @@ module Resolvers
argument :merged_before, Types::TimeType, argument :merged_before, Types::TimeType,
required: false, required: false,
description: 'Merge requests merged before this date.' description: 'Merge requests merged before this date.'
argument :milestone_title, GraphQL::STRING_TYPE, argument :milestone_title, GraphQL::Types::String,
required: false, required: false,
description: 'Title of the milestone.' description: 'Title of the milestone.'
argument :sort, Types::MergeRequestSortEnum, argument :sort, Types::MergeRequestSortEnum,
...@@ -70,11 +70,11 @@ module Resolvers ...@@ -70,11 +70,11 @@ module Resolvers
default_value: :created_desc default_value: :created_desc
negated do negated do
argument :labels, [GraphQL::STRING_TYPE], argument :labels, [GraphQL::Types::String],
required: false, required: false,
as: :label_name, as: :label_name,
description: 'Array of label names. All resolved merge requests will not have these labels.' description: 'Array of label names. All resolved merge requests will not have these labels.'
argument :milestone_title, GraphQL::STRING_TYPE, argument :milestone_title, GraphQL::Types::String,
required: false, required: false,
description: 'Title of the milestone.' description: 'Title of the milestone.'
end end
......
...@@ -6,7 +6,7 @@ module Resolvers ...@@ -6,7 +6,7 @@ module Resolvers
type Types::Metrics::DashboardType, null: true type Types::Metrics::DashboardType, null: true
calls_gitaly! calls_gitaly!
argument :path, GraphQL::STRING_TYPE, argument :path, GraphQL::Types::String,
required: true, required: true,
description: <<~MD description: <<~MD
Path to a file which defines a metrics dashboard eg: `"config/prometheus/common_metrics.yml"`. Path to a file which defines a metrics dashboard eg: `"config/prometheus/common_metrics.yml"`.
......
...@@ -5,7 +5,7 @@ module Resolvers ...@@ -5,7 +5,7 @@ module Resolvers
include Gitlab::Graphql::Authorize::AuthorizeResource include Gitlab::Graphql::Authorize::AuthorizeResource
include TimeFrameArguments include TimeFrameArguments
argument :ids, [GraphQL::ID_TYPE], argument :ids, [GraphQL::Types::ID],
required: false, required: false,
description: 'Array of global milestone IDs, e.g., `"gid://gitlab/Milestone/1"`.' description: 'Array of global milestone IDs, e.g., `"gid://gitlab/Milestone/1"`.'
...@@ -13,11 +13,11 @@ module Resolvers ...@@ -13,11 +13,11 @@ module Resolvers
required: false, required: false,
description: 'Filter milestones by state.' description: 'Filter milestones by state.'
argument :title, GraphQL::STRING_TYPE, argument :title, GraphQL::Types::String,
required: false, required: false,
description: 'The title of the milestone.' description: 'The title of the milestone.'
argument :search_title, GraphQL::STRING_TYPE, argument :search_title, GraphQL::Types::String,
required: false, required: false,
description: 'A search string for the title.' description: 'A search string for the title.'
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
module Resolvers module Resolvers
class NamespaceProjectsResolver < BaseResolver class NamespaceProjectsResolver < BaseResolver
argument :include_subgroups, GraphQL::BOOLEAN_TYPE, argument :include_subgroups, GraphQL::Types::Boolean,
required: false, required: false,
default_value: false, default_value: false,
description: 'Include also subgroup projects.' description: 'Include also subgroup projects.'
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
default_value: nil, default_value: nil,
description: 'Search project with most similar names or paths.' description: 'Search project with most similar names or paths.'
...@@ -17,7 +17,7 @@ module Resolvers ...@@ -17,7 +17,7 @@ module Resolvers
default_value: nil, default_value: nil,
description: 'Sort projects by this criteria.' description: 'Sort projects by this criteria.'
argument :ids, [GraphQL::ID_TYPE], argument :ids, [GraphQL::Types::ID],
required: false, required: false,
default_value: nil, default_value: nil,
description: 'Filter projects by IDs.' description: 'Filter projects by IDs.'
......
...@@ -9,7 +9,7 @@ module Resolvers ...@@ -9,7 +9,7 @@ module Resolvers
required: false, required: false,
default_value: :created_desc default_value: :created_desc
argument :package_name, GraphQL::STRING_TYPE, argument :package_name, GraphQL::Types::String,
description: 'Search a package by name.', description: 'Search a package by name.',
required: false, required: false,
default_value: nil default_value: nil
...@@ -24,7 +24,7 @@ module Resolvers ...@@ -24,7 +24,7 @@ module Resolvers
required: false, required: false,
default_value: nil default_value: nil
argument :include_versionless, GraphQL::BOOLEAN_TYPE, argument :include_versionless, GraphQL::Types::Boolean,
description: 'Include versionless packages.', description: 'Include versionless packages.',
required: false, required: false,
default_value: false default_value: false
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Resolvers module Resolvers
class ProjectMilestonesResolver < MilestonesResolver class ProjectMilestonesResolver < MilestonesResolver
argument :include_ancestors, GraphQL::BOOLEAN_TYPE, argument :include_ancestors, GraphQL::Types::Boolean,
required: false, required: false,
description: "Also return milestones in the project's parent group and its ancestors." description: "Also return milestones in the project's parent group and its ancestors."
......
...@@ -6,11 +6,11 @@ module Resolvers ...@@ -6,11 +6,11 @@ module Resolvers
alias_method :project, :object alias_method :project, :object
argument :iid, GraphQL::ID_TYPE, argument :iid, GraphQL::Types::ID,
required: false, required: false,
description: 'IID of the Pipeline. For example, "1".' description: 'IID of the Pipeline. For example, "1".'
argument :sha, GraphQL::STRING_TYPE, argument :sha, GraphQL::Types::String,
required: false, required: false,
description: 'SHA of the Pipeline. For example, "dyd0f15ay83993f5ab66k927w28673882x99100b".' description: 'SHA of the Pipeline. For example, "dyd0f15ay83993f5ab66k927w28673882x99100b".'
......
...@@ -9,7 +9,7 @@ module Resolvers ...@@ -9,7 +9,7 @@ module Resolvers
authorize :admin_project authorize :admin_project
argument :name, argument :name,
GraphQL::STRING_TYPE, GraphQL::Types::String,
required: false, required: false,
description: 'Project name or key.' description: 'Project name or key.'
......
...@@ -10,7 +10,7 @@ module Resolvers ...@@ -10,7 +10,7 @@ module Resolvers
authorizes_object! authorizes_object!
argument :active, argument :active,
GraphQL::BOOLEAN_TYPE, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Indicates if the integration is active.' description: 'Indicates if the integration is active.'
argument :type, argument :type,
......
...@@ -4,27 +4,27 @@ module Resolvers ...@@ -4,27 +4,27 @@ module Resolvers
class ProjectsResolver < BaseResolver class ProjectsResolver < BaseResolver
type Types::ProjectType, null: true type Types::ProjectType, null: true
argument :membership, GraphQL::BOOLEAN_TYPE, argument :membership, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Limit projects that the current user is a member of.' description: 'Limit projects that the current user is a member of.'
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.'
argument :ids, [GraphQL::ID_TYPE], argument :ids, [GraphQL::Types::ID],
required: false, required: false,
description: 'Filter projects by IDs.' description: 'Filter projects by IDs.'
argument :search_namespaces, GraphQL::BOOLEAN_TYPE, argument :search_namespaces, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Include namespace in project search.' description: 'Include namespace in project search.'
argument :sort, GraphQL::STRING_TYPE, argument :sort, GraphQL::Types::String,
required: false, required: false,
description: 'Sort order of results.' description: 'Sort order of results.'
argument :topics, type: [GraphQL::STRING_TYPE], argument :topics, type: [GraphQL::Types::String],
required: false, required: false,
description: 'Filters projects by topics.' description: 'Filters projects by topics.'
......
...@@ -4,7 +4,7 @@ module Resolvers ...@@ -4,7 +4,7 @@ module Resolvers
class ReleaseResolver < BaseResolver class ReleaseResolver < BaseResolver
type Types::ReleaseType, null: true type Types::ReleaseType, null: true
argument :tag_name, GraphQL::STRING_TYPE, argument :tag_name, GraphQL::Types::String,
required: true, required: true,
description: 'The name of the tag associated to the release.' description: 'The name of the tag associated to the release.'
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
module Resolvers module Resolvers
class RepositoryBranchNamesResolver < BaseResolver class RepositoryBranchNamesResolver < BaseResolver
type ::GraphQL::STRING_TYPE, null: false type ::GraphQL::Types::String, null: false
calls_gitaly! calls_gitaly!
argument :search_pattern, GraphQL::STRING_TYPE, argument :search_pattern, GraphQL::Types::String,
required: true, required: true,
description: 'The pattern to search for branch names by.' description: 'The pattern to search for branch names by.'
argument :offset, GraphQL::INT_TYPE, argument :offset, GraphQL::Types::Int,
required: true, required: true,
description: 'The number of branch names to skip.' description: 'The number of branch names to skip.'
argument :limit, GraphQL::INT_TYPE, argument :limit, GraphQL::Types::Int,
required: true, required: true,
description: 'The number of branch names to return.' description: 'The number of branch names to return.'
......
...@@ -12,7 +12,7 @@ module Resolvers ...@@ -12,7 +12,7 @@ module Resolvers
alias_method :snippet, :object alias_method :snippet, :object
argument :paths, [GraphQL::STRING_TYPE], argument :paths, [GraphQL::Types::String],
required: false, required: false,
description: 'Paths of the blobs.' description: 'Paths of the blobs.'
......
...@@ -22,7 +22,7 @@ module Resolvers ...@@ -22,7 +22,7 @@ module Resolvers
description: 'The type of snippet.' description: 'The type of snippet.'
argument :explore, argument :explore,
GraphQL::BOOLEAN_TYPE, GraphQL::Types::Boolean,
required: false, required: false,
description: 'Explore personal snippets.' description: 'Explore personal snippets.'
......
...@@ -8,7 +8,7 @@ module Resolvers ...@@ -8,7 +8,7 @@ module Resolvers
alias_method :project, :object alias_method :project, :object
when_single do when_single do
argument :name, GraphQL::STRING_TYPE, argument :name, GraphQL::Types::String,
required: true, required: true,
description: 'Name of the Terraform state.' description: 'Name of the Terraform state.'
end end
......
...@@ -10,15 +10,15 @@ module Resolvers ...@@ -10,15 +10,15 @@ module Resolvers
required: false, required: false,
description: 'The action to be filtered.' description: 'The action to be filtered.'
argument :author_id, [GraphQL::ID_TYPE], argument :author_id, [GraphQL::Types::ID],
required: false, required: false,
description: 'The ID of an author.' description: 'The ID of an author.'
argument :project_id, [GraphQL::ID_TYPE], argument :project_id, [GraphQL::Types::ID],
required: false, required: false,
description: 'The ID of a project.' description: 'The ID of a project.'
argument :group_id, [GraphQL::ID_TYPE], argument :group_id, [GraphQL::Types::ID],
required: false, required: false,
description: 'The ID of a group.' description: 'The ID of a group.'
......
...@@ -6,15 +6,15 @@ module Resolvers ...@@ -6,15 +6,15 @@ module Resolvers
calls_gitaly! calls_gitaly!
argument :path, GraphQL::STRING_TYPE, argument :path, GraphQL::Types::String,
required: false, required: false,
default_value: '', default_value: '',
description: 'The path to get the tree for. Default value is the root of the repository.' description: 'The path to get the tree for. Default value is the root of the repository.'
argument :ref, GraphQL::STRING_TYPE, argument :ref, GraphQL::Types::String,
required: false, required: false,
default_value: :head, default_value: :head,
description: 'The commit ref to get the tree for. Default value is HEAD.' description: 'The commit ref to get the tree for. Default value is HEAD.'
argument :recursive, GraphQL::BOOLEAN_TYPE, argument :recursive, GraphQL::Types::Boolean,
required: false, required: false,
default_value: false, default_value: false,
description: 'Used to get a recursive tree. Default is false.' description: 'Used to get a recursive tree. Default is false.'
......
...@@ -4,7 +4,7 @@ module Resolvers ...@@ -4,7 +4,7 @@ module Resolvers
class UserDiscussionsCountResolver < BaseResolver class UserDiscussionsCountResolver < BaseResolver
include Gitlab::Graphql::Authorize::AuthorizeResource include Gitlab::Graphql::Authorize::AuthorizeResource
type GraphQL::INT_TYPE, null: true type GraphQL::Types::Int, null: true
def resolve def resolve
authorize!(object) authorize!(object)
......
...@@ -5,7 +5,7 @@ module Resolvers ...@@ -5,7 +5,7 @@ module Resolvers
include ResolvesProject include ResolvesProject
argument :project_path, argument :project_path,
type: GraphQL::STRING_TYPE, type: GraphQL::Types::String,
required: false, required: false,
description: <<~DESC description: <<~DESC
The full-path of the project the authored merge requests should be in. The full-path of the project the authored merge requests should be in.
......
...@@ -4,7 +4,7 @@ module Resolvers ...@@ -4,7 +4,7 @@ module Resolvers
class UserNotesCountResolver < BaseResolver class UserNotesCountResolver < BaseResolver
include Gitlab::Graphql::Authorize::AuthorizeResource include Gitlab::Graphql::Authorize::AuthorizeResource
type GraphQL::INT_TYPE, null: true type GraphQL::Types::Int, null: true
def resolve def resolve
authorize!(object) authorize!(object)
......
...@@ -10,7 +10,7 @@ module Resolvers ...@@ -10,7 +10,7 @@ module Resolvers
required: false, required: false,
description: 'ID of the User.' description: 'ID of the User.'
argument :username, GraphQL::STRING_TYPE, argument :username, GraphQL::Types::String,
required: false, required: false,
description: 'Username of the User.' description: 'Username of the User.'
......
...@@ -4,7 +4,7 @@ module Resolvers ...@@ -4,7 +4,7 @@ module Resolvers
class UserStarredProjectsResolver < BaseResolver class UserStarredProjectsResolver < BaseResolver
type Types::ProjectType.connection_type, null: true type Types::ProjectType.connection_type, null: true
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: 'Search query.' description: 'Search query.'
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Resolvers module Resolvers
module Users module Users
class GroupCountResolver < BaseResolver class GroupCountResolver < BaseResolver
type GraphQL::INT_TYPE, null: true type GraphQL::Types::Int, null: true
alias_method :user, :object alias_method :user, :object
......
...@@ -7,11 +7,11 @@ module Resolvers ...@@ -7,11 +7,11 @@ module Resolvers
type Types::UserType.connection_type, null: true type Types::UserType.connection_type, null: true
description 'Find Users' description 'Find Users'
argument :ids, [GraphQL::ID_TYPE], argument :ids, [GraphQL::Types::ID],
required: false, required: false,
description: 'List of user Global IDs.' description: 'List of user Global IDs.'
argument :usernames, [GraphQL::STRING_TYPE], required: false, argument :usernames, [GraphQL::Types::String], required: false,
description: 'List of usernames.' description: 'List of usernames.'
argument :sort, Types::SortEnum, argument :sort, Types::SortEnum,
...@@ -19,11 +19,11 @@ module Resolvers ...@@ -19,11 +19,11 @@ module Resolvers
required: false, required: false,
default_value: :created_desc default_value: :created_desc
argument :search, GraphQL::STRING_TYPE, argument :search, GraphQL::Types::String,
required: false, required: false,
description: "Query to search users by name, username, or primary email." description: "Query to search users by name, username, or primary email."
argument :admins, GraphQL::BOOLEAN_TYPE, argument :admins, GraphQL::Types::Boolean,
required: false, required: false,
default_value: false, default_value: false,
description: 'Return only admin users.' description: 'Return only admin users.'
......
...@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserDiscussionsCountResolver do ...@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserDiscussionsCountResolver do
let_it_be(:private_project) { create(:project, :repository, :private) } let_it_be(:private_project) { create(:project, :repository, :private) }
specify do specify do
expect(described_class).to have_nullable_graphql_type(GraphQL::INT_TYPE) expect(described_class).to have_nullable_graphql_type(GraphQL::Types::Int)
end end
context 'when counting discussions from an epic' do context 'when counting discussions from an epic' do
......
...@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserNotesCountResolver do ...@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserNotesCountResolver do
let_it_be(:private_project) { create(:project, :repository, :private) } let_it_be(:private_project) { create(:project, :repository, :private) }
specify do specify do
expect(described_class).to have_nullable_graphql_type(GraphQL::INT_TYPE) expect(described_class).to have_nullable_graphql_type(GraphQL::Types::Int)
end end
context 'when counting notes from an epic' do context 'when counting notes from an epic' do
......
...@@ -7,8 +7,8 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -7,8 +7,8 @@ RSpec.describe Resolvers::BaseResolver do
let(:resolver) do let(:resolver) do
Class.new(described_class) do Class.new(described_class) do
argument :test, ::GraphQL::INT_TYPE, required: false argument :test, ::GraphQL::Types::Int, required: false
type [::GraphQL::INT_TYPE], null: true type [::GraphQL::Types::Int], null: true
def resolve(test: 100) def resolve(test: 100)
process(object) process(object)
...@@ -22,7 +22,7 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -22,7 +22,7 @@ RSpec.describe Resolvers::BaseResolver do
let(:last_resolver) do let(:last_resolver) do
Class.new(described_class) do Class.new(described_class) do
type [::GraphQL::INT_TYPE], null: true type [::GraphQL::Types::Int], null: true
def resolve(**args) def resolve(**args)
[1, 2] [1, 2]
...@@ -36,11 +36,11 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -36,11 +36,11 @@ RSpec.describe Resolvers::BaseResolver do
context 'for a connection of scalars' do context 'for a connection of scalars' do
let(:resolver) do let(:resolver) do
Class.new(described_class) do Class.new(described_class) do
type ::GraphQL::INT_TYPE.connection_type, null: true type ::GraphQL::Types::Int.connection_type, null: true
end end
end end
it { is_expected.to eq(::GraphQL::INT_TYPE) } it { is_expected.to eq(::GraphQL::Types::Int) }
end end
context 'for a connection of objects' do context 'for a connection of objects' do
...@@ -64,21 +64,21 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -64,21 +64,21 @@ RSpec.describe Resolvers::BaseResolver do
context 'for a list type' do context 'for a list type' do
let(:resolver) do let(:resolver) do
Class.new(described_class) do Class.new(described_class) do
type [::GraphQL::STRING_TYPE], null: true type [::GraphQL::Types::String], null: true
end end
end end
it { is_expected.to eq(::GraphQL::STRING_TYPE) } it { is_expected.to eq(::GraphQL::Types::String) }
end end
context 'for a scalar type' do context 'for a scalar type' do
let(:resolver) do let(:resolver) do
Class.new(described_class) do Class.new(described_class) do
type ::GraphQL::BOOLEAN_TYPE, null: true type ::GraphQL::Types::Boolean, null: true
end end
end end
it { is_expected.to eq(::GraphQL::BOOLEAN_TYPE) } it { is_expected.to eq(::GraphQL::Types::Boolean) }
end end
end end
...@@ -88,7 +88,7 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -88,7 +88,7 @@ RSpec.describe Resolvers::BaseResolver do
end end
it 'has the correct (singular) type' do it 'has the correct (singular) type' do
expect(resolver.single.type).to eq(::GraphQL::INT_TYPE) expect(resolver.single.type).to eq(::GraphQL::Types::Int)
end end
it 'returns the same subclass every time' do it 'returns the same subclass every time' do
...@@ -105,10 +105,10 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -105,10 +105,10 @@ RSpec.describe Resolvers::BaseResolver do
describe '.when_single' do describe '.when_single' do
let(:resolver) do let(:resolver) do
Class.new(described_class) do Class.new(described_class) do
type [::GraphQL::INT_TYPE], null: true type [::GraphQL::Types::Int], null: true
when_single do when_single do
argument :foo, ::GraphQL::INT_TYPE, required: true argument :foo, ::GraphQL::Types::Int, required: true
end end
def resolve(foo: 1) def resolve(foo: 1)
...@@ -138,14 +138,14 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -138,14 +138,14 @@ RSpec.describe Resolvers::BaseResolver do
context 'multiple when_single blocks' do context 'multiple when_single blocks' do
let(:resolver) do let(:resolver) do
Class.new(described_class) do Class.new(described_class) do
type [::GraphQL::INT_TYPE], null: true type [::GraphQL::Types::Int], null: true
when_single do when_single do
argument :foo, ::GraphQL::INT_TYPE, required: true argument :foo, ::GraphQL::Types::Int, required: true
end end
when_single do when_single do
argument :bar, ::GraphQL::INT_TYPE, required: true argument :bar, ::GraphQL::Types::Int, required: true
end end
def resolve(foo: 1, bar: 2) def resolve(foo: 1, bar: 2)
...@@ -168,7 +168,7 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -168,7 +168,7 @@ RSpec.describe Resolvers::BaseResolver do
let(:subclass) do let(:subclass) do
Class.new(resolver) do Class.new(resolver) do
when_single do when_single do
argument :inc, ::GraphQL::INT_TYPE, required: true argument :inc, ::GraphQL::Types::Int, required: true
end end
def resolve(foo:, inc:) def resolve(foo:, inc:)
...@@ -194,7 +194,7 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -194,7 +194,7 @@ RSpec.describe Resolvers::BaseResolver do
context 'when the resolver returns early' do context 'when the resolver returns early' do
let(:resolver) do let(:resolver) do
Class.new(described_class) do Class.new(described_class) do
type [::GraphQL::STRING_TYPE], null: true type [::GraphQL::Types::String], null: true
def ready?(**args) def ready?(**args)
[false, %w[early return]] [false, %w[early return]]
...@@ -237,14 +237,14 @@ RSpec.describe Resolvers::BaseResolver do ...@@ -237,14 +237,14 @@ RSpec.describe Resolvers::BaseResolver do
context 'when field is a connection' do context 'when field is a connection' do
it 'increases complexity based on arguments' do it 'increases complexity based on arguments' do
field = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE.connection_type, resolver_class: described_class, null: false, max_page_size: 1) field = Types::BaseField.new(name: 'test', type: GraphQL::Types::String.connection_type, resolver_class: described_class, null: false, max_page_size: 1)
expect(field.to_graphql.complexity.call({}, { sort: 'foo' }, 1)).to eq 3 expect(field.to_graphql.complexity.call({}, { sort: 'foo' }, 1)).to eq 3
expect(field.to_graphql.complexity.call({}, { search: 'foo' }, 1)).to eq 7 expect(field.to_graphql.complexity.call({}, { search: 'foo' }, 1)).to eq 7
end end
it 'does not increase complexity when filtering by iids' do it 'does not increase complexity when filtering by iids' do
field = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE.connection_type, resolver_class: described_class, null: false, max_page_size: 100) field = Types::BaseField.new(name: 'test', type: GraphQL::Types::String.connection_type, resolver_class: described_class, null: false, max_page_size: 100)
expect(field.to_graphql.complexity.call({}, { sort: 'foo' }, 1)).to eq 6 expect(field.to_graphql.complexity.call({}, { sort: 'foo' }, 1)).to eq 6
expect(field.to_graphql.complexity.call({}, { sort: 'foo', iid: 1 }, 1)).to eq 3 expect(field.to_graphql.complexity.call({}, { sort: 'foo', iid: 1 }, 1)).to eq 3
......
...@@ -20,7 +20,7 @@ RSpec.describe ::CachingArrayResolver do ...@@ -20,7 +20,7 @@ RSpec.describe ::CachingArrayResolver do
Class.new(::Resolvers::BaseResolver) do Class.new(::Resolvers::BaseResolver) do
include mod include mod
type [::Types::UserType], null: true type [::Types::UserType], null: true
argument :is_admin, ::GraphQL::BOOLEAN_TYPE, required: false argument :is_admin, ::GraphQL::Types::Boolean, required: false
def query_input(is_admin:) def query_input(is_admin:)
is_admin is_admin
...@@ -50,7 +50,7 @@ RSpec.describe ::CachingArrayResolver do ...@@ -50,7 +50,7 @@ RSpec.describe ::CachingArrayResolver do
Class.new(::Resolvers::BaseResolver) do Class.new(::Resolvers::BaseResolver) do
include mod include mod
type [::Types::UserType], null: true type [::Types::UserType], null: true
argument :username, ::GraphQL::STRING_TYPE, required: false argument :username, ::GraphQL::Types::String, required: false
def query_input(username:) def query_input(username:)
username username
......
...@@ -50,7 +50,7 @@ RSpec.describe ResolvesPipelines do ...@@ -50,7 +50,7 @@ RSpec.describe ResolvesPipelines do
end end
it 'increases field complexity based on arguments' do it 'increases field complexity based on arguments' do
field = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: resolver, null: false, max_page_size: 1) field = Types::BaseField.new(name: 'test', type: GraphQL::Types::String, resolver_class: resolver, null: false, max_page_size: 1)
expect(field.to_graphql.complexity.call({}, {}, 1)).to eq 2 expect(field.to_graphql.complexity.call({}, {}, 1)).to eq 2
expect(field.to_graphql.complexity.call({}, { sha: 'foo' }, 1)).to eq 4 expect(field.to_graphql.complexity.call({}, { sha: 'foo' }, 1)).to eq 4
......
...@@ -9,7 +9,7 @@ RSpec.describe Resolvers::EchoResolver do ...@@ -9,7 +9,7 @@ RSpec.describe Resolvers::EchoResolver do
let(:text) { 'Message test' } let(:text) { 'Message test' }
specify do specify do
expect(described_class).to have_non_null_graphql_type(::GraphQL::STRING_TYPE) expect(described_class).to have_non_null_graphql_type(::GraphQL::Types::String)
end end
describe '#resolve' do describe '#resolve' do
......
...@@ -407,7 +407,7 @@ RSpec.describe Resolvers::IssuesResolver do ...@@ -407,7 +407,7 @@ RSpec.describe Resolvers::IssuesResolver do
end end
it 'increases field complexity based on arguments' do it 'increases field complexity based on arguments' do
field = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE.connection_type, resolver_class: described_class, null: false, max_page_size: 100) field = Types::BaseField.new(name: 'test', type: GraphQL::Types::String.connection_type, resolver_class: described_class, null: false, max_page_size: 100)
expect(field.to_graphql.complexity.call({}, {}, 1)).to eq 4 expect(field.to_graphql.complexity.call({}, {}, 1)).to eq 4
expect(field.to_graphql.complexity.call({}, { labelName: 'foo' }, 1)).to eq 8 expect(field.to_graphql.complexity.call({}, { labelName: 'foo' }, 1)).to eq 8
......
...@@ -145,7 +145,7 @@ RSpec.describe Resolvers::NamespaceProjectsResolver do ...@@ -145,7 +145,7 @@ RSpec.describe Resolvers::NamespaceProjectsResolver do
end end
it 'has an high complexity regardless of arguments' do it 'has an high complexity regardless of arguments' do
field = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE.connection_type, resolver_class: described_class, null: false, max_page_size: 100) field = Types::BaseField.new(name: 'test', type: GraphQL::Types::String.connection_type, resolver_class: described_class, null: false, max_page_size: 100)
expect(field.to_graphql.complexity.call({}, {}, 1)).to eq 24 expect(field.to_graphql.complexity.call({}, {}, 1)).to eq 24
expect(field.to_graphql.complexity.call({}, { include_subgroups: true }, 1)).to eq 24 expect(field.to_graphql.complexity.call({}, { include_subgroups: true }, 1)).to eq 24
......
...@@ -28,8 +28,8 @@ RSpec.describe Resolvers::ProjectResolver do ...@@ -28,8 +28,8 @@ RSpec.describe Resolvers::ProjectResolver do
end end
it 'does not increase complexity depending on number of load limits' do it 'does not increase complexity depending on number of load limits' do
field1 = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: described_class, null: false, max_page_size: 100) field1 = Types::BaseField.new(name: 'test', type: GraphQL::Types::String, resolver_class: described_class, null: false, max_page_size: 100)
field2 = Types::BaseField.new(name: 'test', type: GraphQL::STRING_TYPE, resolver_class: described_class, null: false, max_page_size: 1) field2 = Types::BaseField.new(name: 'test', type: GraphQL::Types::String, resolver_class: described_class, null: false, max_page_size: 1)
expect(field1.to_graphql.complexity.call({}, {}, 1)).to eq 2 expect(field1.to_graphql.complexity.call({}, {}, 1)).to eq 2
expect(field2.to_graphql.complexity.call({}, {}, 1)).to eq 2 expect(field2.to_graphql.complexity.call({}, {}, 1)).to eq 2
......
...@@ -43,7 +43,8 @@ RSpec.describe Resolvers::Terraform::StatesResolver.single do ...@@ -43,7 +43,8 @@ RSpec.describe Resolvers::Terraform::StatesResolver.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
......
...@@ -16,7 +16,7 @@ RSpec.describe Resolvers::UserDiscussionsCountResolver do ...@@ -16,7 +16,7 @@ RSpec.describe Resolvers::UserDiscussionsCountResolver do
let_it_be(:private_discussion) { create_list(:discussion_note_on_issue, 3, noteable: private_issue, project: private_project) } let_it_be(:private_discussion) { create_list(:discussion_note_on_issue, 3, noteable: private_issue, project: private_project) }
specify do specify do
expect(described_class).to have_nullable_graphql_type(GraphQL::INT_TYPE) expect(described_class).to have_nullable_graphql_type(GraphQL::Types::Int)
end end
context 'when counting discussions from a public issue' do context 'when counting discussions from a public issue' do
......
...@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserNotesCountResolver do ...@@ -11,7 +11,7 @@ RSpec.describe Resolvers::UserNotesCountResolver do
let_it_be(:private_project) { create(:project, :repository, :private) } let_it_be(:private_project) { create(:project, :repository, :private) }
specify do specify do
expect(described_class).to have_nullable_graphql_type(GraphQL::INT_TYPE) expect(described_class).to have_nullable_graphql_type(GraphQL::Types::Int)
end end
context 'when counting notes from an issue' do context 'when counting notes from an issue' do
......
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