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