Commit 6baef4af authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch '292426-fix-graphql-descriptions-rubocop-offenses-2' into 'master'

Fix Graphql/Descriptions FOSS resolver offenses [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!51164
parents 11791b17 fec8d267
......@@ -766,61 +766,6 @@ RSpec/TimecopTravel:
Graphql/Descriptions:
Exclude:
- 'app/graphql/resolvers/admin/analytics/instance_statistics/measurements_resolver.rb'
- 'app/graphql/resolvers/alert_management/alert_resolver.rb'
- 'app/graphql/resolvers/alert_management/alert_status_counts_resolver.rb'
- 'app/graphql/resolvers/board_list_issues_resolver.rb'
- 'app/graphql/resolvers/board_lists_resolver.rb'
- 'app/graphql/resolvers/board_resolver.rb'
- 'app/graphql/resolvers/boards_resolver.rb'
- 'app/graphql/resolvers/ci/config_resolver.rb'
- 'app/graphql/resolvers/ci/jobs_resolver.rb'
- 'app/graphql/resolvers/ci/runner_setup_resolver.rb'
- 'app/graphql/resolvers/concerns/issue_resolver_arguments.rb'
- 'app/graphql/resolvers/concerns/resolves_pipelines.rb'
- 'app/graphql/resolvers/concerns/resolves_snippets.rb'
- 'app/graphql/resolvers/concerns/time_frame_arguments.rb'
- 'app/graphql/resolvers/container_repositories_resolver.rb'
- 'app/graphql/resolvers/design_management/design_at_version_resolver.rb'
- 'app/graphql/resolvers/design_management/design_resolver.rb'
- 'app/graphql/resolvers/design_management/designs_resolver.rb'
- 'app/graphql/resolvers/design_management/version/design_at_version_resolver.rb'
- 'app/graphql/resolvers/design_management/version/designs_at_version_resolver.rb'
- 'app/graphql/resolvers/design_management/version_in_collection_resolver.rb'
- 'app/graphql/resolvers/design_management/version_resolver.rb'
- 'app/graphql/resolvers/design_management/versions_resolver.rb'
- 'app/graphql/resolvers/echo_resolver.rb'
- 'app/graphql/resolvers/environments_resolver.rb'
- 'app/graphql/resolvers/error_tracking/sentry_detailed_error_resolver.rb'
- 'app/graphql/resolvers/error_tracking/sentry_error_stack_trace_resolver.rb'
- 'app/graphql/resolvers/error_tracking/sentry_errors_resolver.rb'
- 'app/graphql/resolvers/full_path_resolver.rb'
- 'app/graphql/resolvers/group_members_resolver.rb'
- 'app/graphql/resolvers/group_milestones_resolver.rb'
- 'app/graphql/resolvers/issues_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/metrics/dashboards/annotation_resolver.rb'
- 'app/graphql/resolvers/milestones_resolver.rb'
- 'app/graphql/resolvers/namespace_projects_resolver.rb'
- 'app/graphql/resolvers/project_members_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/releases_resolver.rb'
- 'app/graphql/resolvers/snippets/blobs_resolver.rb'
- 'app/graphql/resolvers/snippets_resolver.rb'
- 'app/graphql/resolvers/todo_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/snippets_resolver.rb'
- 'app/graphql/resolvers/users_resolver.rb'
- 'app/graphql/types/access_level_type.rb'
- 'app/graphql/types/admin/analytics/instance_statistics/measurement_type.rb'
- 'app/graphql/types/admin/sidekiq_queues/delete_jobs_response_type.rb'
......
......@@ -11,15 +11,15 @@ module Resolvers
argument :identifier, Types::Admin::Analytics::InstanceStatistics::MeasurementIdentifierEnum,
required: true,
description: 'The type of measurement/statistics to retrieve'
description: 'The type of measurement/statistics to retrieve.'
argument :recorded_after, Types::TimeType,
required: false,
description: 'Measurement recorded after this date'
description: 'Measurement recorded after this date.'
argument :recorded_before, Types::TimeType,
required: false,
description: 'Measurement recorded before this date'
description: 'Measurement recorded before this date.'
def resolve(identifier:, recorded_before: nil, recorded_after: nil)
authorize!
......
......@@ -7,19 +7,19 @@ module Resolvers
argument :iid, GraphQL::STRING_TYPE,
required: false,
description: 'IID of the alert. For example, "1"'
description: 'IID of the alert. For example, "1".'
argument :statuses, [Types::AlertManagement::StatusEnum],
as: :status,
required: false,
description: 'Alerts with the specified statues. For example, [TRIGGERED]'
description: 'Alerts with the specified statues. For example, [TRIGGERED].'
argument :sort, Types::AlertManagement::AlertSortEnum,
description: 'Sort alerts by this criteria',
description: 'Sort alerts by this criteria.',
required: false
argument :domain, Types::AlertManagement::DomainFilterEnum,
description: 'Filter query for given domain',
description: 'Filter query for given domain.',
required: true,
default_value: 'operations'
......@@ -29,7 +29,7 @@ module Resolvers
argument :assignee_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of a user assigned to the issue'
description: 'Username of a user assigned to the issue.'
type Types::AlertManagement::AlertType, null: true
......
......@@ -11,7 +11,7 @@ module Resolvers
argument :assignee_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of a user assigned to the issue'
description: 'Username of a user assigned to the issue.'
def resolve(**args)
::Gitlab::AlertManagement::AlertStatusCounts.new(context[:current_user], object, args)
......
......@@ -6,7 +6,7 @@ module Resolvers
argument :filters, Types::Boards::BoardIssueInputType,
required: false,
description: 'Filters applied when selecting issues in the board list'
description: 'Filters applied when selecting issues in the board list.'
type Types::IssueType, null: true
......
......@@ -13,11 +13,11 @@ module Resolvers
argument :id, Types::GlobalIDType[List],
required: false,
description: 'Find a list by its global ID'
description: 'Find a list by its global ID.'
argument :issue_filters, Types::Boards::BoardIssueInputType,
required: false,
description: 'Filters applied when getting issue metadata in the board list'
description: 'Filters applied when getting issue metadata in the board list.'
alias_method :board, :object
......
......@@ -8,7 +8,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::Board],
required: true,
description: 'The board\'s ID'
description: 'The board\'s ID.'
def resolve(id: nil)
return unless parent
......
......@@ -6,7 +6,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::Board],
required: false,
description: 'Find a board by its ID'
description: 'Find a board by its ID.'
def resolve(id: nil)
# The project or group could have been loaded in batch by `BatchLoader`.
......
......@@ -12,11 +12,11 @@ module Resolvers
argument :project_path, GraphQL::ID_TYPE,
required: true,
description: 'The project of the CI config'
description: 'The project of the CI config.'
argument :content, GraphQL::STRING_TYPE,
required: true,
description: 'Contents of .gitlab-ci.yml'
description: "Contents of '.gitlab-ci.yml'."
def resolve(project_path:, content:)
project = authorized_find!(project_path: project_path)
......
......@@ -9,7 +9,7 @@ module Resolvers
argument :security_report_types, [Types::Security::ReportTypeEnum],
required: false,
description: 'Filter jobs by the type of security report they produce'
description: 'Filter jobs by the type of security report they produce.'
def resolve(security_report_types: [])
if security_report_types.present?
......
......@@ -7,19 +7,19 @@ module Resolvers
argument :platform, GraphQL::STRING_TYPE,
required: true,
description: 'Platform to generate the instructions for'
description: 'Platform to generate the instructions for.'
argument :architecture, GraphQL::STRING_TYPE,
required: true,
description: 'Architecture to generate the instructions for'
description: 'Architecture to generate the instructions for.'
argument :project_id, ::Types::GlobalIDType[::Project],
required: false,
description: 'Project to register the runner for'
description: 'Project to register the runner for.'
argument :group_id, ::Types::GlobalIDType[::Group],
required: false,
description: 'Group to register the runner for'
description: 'Group to register the runner for.'
def resolve(platform:, architecture:, **args)
instructions = Gitlab::Ci::RunnerInstructions.new(
......
......@@ -8,52 +8,52 @@ module IssueResolverArguments
argument :iid, GraphQL::STRING_TYPE,
required: false,
description: 'IID of the issue. For example, "1"'
description: 'IID of the issue. For example, "1".'
argument :iids, [GraphQL::STRING_TYPE],
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.to_list_type,
required: false,
description: 'Labels applied to this issue'
description: 'Labels applied to this issue.'
argument :milestone_title, GraphQL::STRING_TYPE.to_list_type,
required: false,
description: 'Milestone applied to this issue'
description: 'Milestone applied to this issue.'
argument :author_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of the author of the issue'
description: 'Username of the author of the issue.'
argument :assignee_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of a user assigned to the issue'
description: 'Username of a user assigned to the issue.'
argument :assignee_usernames, [GraphQL::STRING_TYPE],
required: false,
description: 'Usernames of users assigned to the issue'
description: 'Usernames of users assigned to the issue.'
argument :assignee_id, GraphQL::STRING_TYPE,
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,
required: false,
description: 'Issues created before this date'
description: 'Issues created before this date.'
argument :created_after, Types::TimeType,
required: false,
description: 'Issues created after this date'
description: 'Issues created after this date.'
argument :updated_before, Types::TimeType,
required: false,
description: 'Issues updated before this date'
description: 'Issues updated before this date.'
argument :updated_after, Types::TimeType,
required: false,
description: 'Issues updated after this date'
description: 'Issues updated after this date.'
argument :closed_before, Types::TimeType,
required: false,
description: 'Issues closed before this date'
description: 'Issues closed before this date.'
argument :closed_after, Types::TimeType,
required: false,
description: 'Issues closed after this date'
description: 'Issues closed after this date.'
argument :search, GraphQL::STRING_TYPE,
required: false,
description: 'Search query for issue title or description'
description: 'Search query for issue title or description.'
argument :types, [Types::IssueTypeEnum],
as: :issue_types,
description: 'Filter issues by the given issue types',
description: 'Filter issues by the given issue types.',
required: false
end
......
......@@ -8,15 +8,15 @@ module ResolvesPipelines
argument :status,
Types::Ci::PipelineStatusEnum,
required: false,
description: "Filter pipelines by their status"
description: "Filter pipelines by their status."
argument :ref,
GraphQL::STRING_TYPE,
required: false,
description: "Filter pipelines by the ref they are run for"
description: "Filter pipelines by the ref they are run for."
argument :sha,
GraphQL::STRING_TYPE,
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
class_methods do
......
......@@ -8,11 +8,11 @@ module ResolvesSnippets
argument :ids, [::Types::GlobalIDType[::Snippet]],
required: false,
description: 'Array of global snippet ids, e.g., "gid://gitlab/ProjectSnippet/1"'
description: 'Array of global snippet ids, e.g., "gid://gitlab/ProjectSnippet/1".'
argument :visibility, Types::Snippets::VisibilityScopesEnum,
required: false,
description: 'The visibility of the snippet'
description: 'The visibility of the snippet.'
end
def resolve(**args)
......
......@@ -18,7 +18,7 @@ module TimeFrameArguments
argument :timeframe, Types::TimeframeInputType,
required: false,
description: 'List items overlapping the given timeframe'
description: 'List items overlapping the given timeframe.'
end
# TODO: remove when the start_date and end_date arguments are removed
......
......@@ -8,7 +8,7 @@ module Resolvers
argument :name, GraphQL::STRING_TYPE,
required: false,
description: 'Filter the container repositories by their name'
description: 'Filter the container repositories by their name.'
def resolve(name: nil)
ContainerRepositoriesFinder.new(user: current_user, subject: object, params: { name: name })
......
......@@ -11,7 +11,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::DesignManagement::DesignAtVersion],
required: true,
description: 'The Global ID of the design at this version'
description: 'The Global ID of the design at this version.'
def resolve(id:)
authorized_find!(id: id)
......
......@@ -9,11 +9,11 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::DesignManagement::Design],
required: false,
description: 'Find a design by its ID'
description: 'Find a design by its ID.'
argument :filename, GraphQL::STRING_TYPE,
required: false,
description: 'Find a design by its filename'
description: 'Find a design by its filename.'
def resolve(filename: nil, id: nil)
params = parse_args(filename, id)
......
......@@ -10,10 +10,10 @@ module Resolvers
argument :ids, [DesignID],
required: false,
description: 'Filters designs by their ID'
description: 'Filters designs by their ID.'
argument :filenames, [GraphQL::STRING_TYPE],
required: false,
description: 'Filters designs by their filename'
description: 'Filters designs by their filename.'
argument :at_version, VersionID,
required: false,
description: 'Filters designs to only those that existed at the version. ' \
......
......@@ -19,13 +19,13 @@ module Resolvers
argument :id, DesignAtVersionID,
required: false,
as: :design_at_version_id,
description: 'The ID of the DesignAtVersion'
description: 'The ID of the DesignAtVersion.'
argument :design_id, DesignID,
required: false,
description: 'The ID of a specific design'
description: 'The ID of a specific design.'
argument :filename, GraphQL::STRING_TYPE,
required: false,
description: 'The filename of a specific design'
description: 'The filename of a specific design.'
def self.single
self
......
......@@ -15,11 +15,11 @@ module Resolvers
argument :ids, [DesignID],
required: false,
description: 'Filters designs by their ID'
description: 'Filters designs by their ID.'
argument :filenames,
[GraphQL::STRING_TYPE],
required: false,
description: 'Filters designs by their filename'
description: 'Filters designs by their filename.'
def self.single
::Resolvers::DesignManagement::Version::DesignAtVersionResolver
......
......@@ -17,11 +17,11 @@ module Resolvers
argument :sha, GraphQL::STRING_TYPE,
required: false,
description: "The SHA256 of a specific version"
description: "The SHA256 of a specific version."
argument :id, VersionID,
as: :version_id,
required: false,
description: 'The Global ID of the version'
description: 'The Global ID of the version.'
def resolve(version_id: nil, sha: nil)
# TODO: remove this line when the compatibility layer is removed
......
......@@ -11,7 +11,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::DesignManagement::Version],
required: true,
description: 'The Global ID of the version'
description: 'The Global ID of the version.'
def resolve(id:)
authorized_find!(id: id)
......
......@@ -14,12 +14,12 @@ module Resolvers
argument :earlier_or_equal_to_sha, GraphQL::STRING_TYPE,
as: :sha,
required: false,
description: 'The SHA256 of the most recent acceptable version'
description: 'The SHA256 of the most recent acceptable version.'
argument :earlier_or_equal_to_id, VersionID,
as: :id,
required: false,
description: 'The Global ID of the most recent acceptable version'
description: 'The Global ID of the most recent acceptable version.'
# This resolver has a custom singular resolver
def self.single
......
......@@ -6,7 +6,7 @@ module Resolvers
description 'Testing endpoint to validate the API with'
argument :text, GraphQL::STRING_TYPE, required: true,
description: 'Text to echo back'
description: 'Text to echo back.'
def resolve(text:)
username = current_user&.username
......
......@@ -4,15 +4,15 @@ module Resolvers
class EnvironmentsResolver < BaseResolver
argument :name, GraphQL::STRING_TYPE,
required: false,
description: 'Name of the environment'
description: 'Name of the environment.'
argument :search, GraphQL::STRING_TYPE,
required: false,
description: 'Search query for environment name'
description: 'Search query for environment name.'
argument :states, [GraphQL::STRING_TYPE],
required: false,
description: 'States of environments that should be included in result'
description: 'States of environments that should be included in result.'
type Types::EnvironmentType, null: true
......
......@@ -7,7 +7,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::Gitlab::ErrorTracking::DetailedError],
required: true,
description: 'ID of the Sentry issue'
description: 'ID of the Sentry issue.'
def resolve(id:)
# TODO: remove this line when the compatibility layer is removed
......
......@@ -7,7 +7,7 @@ module Resolvers
argument :id, ::Types::GlobalIDType[::Gitlab::ErrorTracking::DetailedError],
required: true,
description: 'ID of the Sentry issue'
description: 'ID of the Sentry issue.'
def resolve(id:)
# TODO: remove this line when the compatibility layer is removed
......
......@@ -7,12 +7,12 @@ module Resolvers
extension Gitlab::Graphql::Extensions::ExternallyPaginatedArrayExtension
argument :search_term, ::GraphQL::STRING_TYPE,
description: 'Search query for the Sentry error details',
description: 'Search query for the Sentry error details.',
required: false
# TODO: convert to Enum
argument :sort, ::GraphQL::STRING_TYPE,
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
delegate :project, to: :object
......
......@@ -7,7 +7,7 @@ module Resolvers
prepended do
argument :full_path, GraphQL::ID_TYPE,
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
def model_by_full_path(model, full_path)
......
......@@ -7,7 +7,7 @@ module Resolvers
authorize :read_group_member
argument :relations, [Types::GroupMemberRelationEnum],
description: 'Filter members by the given member relations',
description: 'Filter members by the given member relations.',
required: false,
default_value: GroupMembersFinder::DEFAULT_RELATIONS
......
......@@ -5,7 +5,7 @@ module Resolvers
class GroupMilestonesResolver < MilestonesResolver
argument :include_descendants, GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Also return milestones in all subgroups and subprojects'
description: 'Also return milestones in all subgroups and subprojects.'
type Types::MilestoneType.connection_type, null: true
......
......@@ -6,9 +6,9 @@ module Resolvers
argument :state, Types::IssuableStateEnum,
required: false,
description: 'Current state of this issue'
description: 'Current state of this issue.'
argument :sort, Types::IssueSortEnum,
description: 'Sort issues by this criteria',
description: 'Sort issues by this criteria.',
required: false,
default_value: :created_desc
......
......@@ -9,7 +9,7 @@ module Resolvers
argument :search, GraphQL::STRING_TYPE,
required: false,
description: 'Search query'
description: 'Search query.'
def resolve_with_lookahead(**args)
authorize!(object)
......
......@@ -11,7 +11,7 @@ module Resolvers
argument :iid, GraphQL::STRING_TYPE,
required: true,
as: :iids,
description: 'IID of the merge request, for example `1`'
description: 'IID of the merge request, for example `1`.'
def no_results_possible?(args)
project.nil?
......
......@@ -11,24 +11,24 @@ module Resolvers
def self.accept_assignee
argument :assignee_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of the assignee'
description: 'Username of the assignee.'
end
def self.accept_author
argument :author_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of the author'
description: 'Username of the author.'
end
def self.accept_reviewer
argument :reviewer_username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of the reviewer'
description: 'Username of the reviewer.'
end
argument :iids, [GraphQL::STRING_TYPE],
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],
required: false,
......@@ -50,15 +50,15 @@ module Resolvers
description: 'Array of label names. All resolved merge requests will have all of these labels.'
argument :merged_after, Types::TimeType,
required: false,
description: 'Merge requests merged after this date'
description: 'Merge requests merged after this date.'
argument :merged_before, Types::TimeType,
required: false,
description: 'Merge requests merged before this date'
description: 'Merge requests merged before this date.'
argument :milestone_title, GraphQL::STRING_TYPE,
required: false,
description: 'Title of the milestone'
description: 'Title of the milestone.'
argument :sort, Types::MergeRequestSortEnum,
description: 'Sort merge requests by this criteria',
description: 'Sort merge requests by this criteria.',
required: false,
default_value: :created_desc
......
......@@ -5,7 +5,7 @@ module Resolvers
class DashboardResolver < Resolvers::BaseResolver
argument :path, GraphQL::STRING_TYPE,
required: true,
description: "Path to a file which defines metrics dashboard eg: 'config/prometheus/common_metrics.yml'"
description: "Path to a file which defines metrics dashboard eg: 'config/prometheus/common_metrics.yml'."
type Types::Metrics::DashboardType, null: true
......
......@@ -6,11 +6,11 @@ module Resolvers
class AnnotationResolver < Resolvers::BaseResolver
argument :from, Types::TimeType,
required: true,
description: "Timestamp marking date and time from which annotations need to be fetched"
description: "Timestamp marking date and time from which annotations need to be fetched."
argument :to, Types::TimeType,
required: false,
description: "Timestamp marking date and time to which annotations need to be fetched"
description: "Timestamp marking date and time to which annotations need to be fetched."
type Types::Metrics::Dashboards::AnnotationType, null: true
......
......@@ -7,23 +7,23 @@ module Resolvers
argument :ids, [GraphQL::ID_TYPE],
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".'
argument :state, Types::MilestoneStateEnum,
required: false,
description: 'Filter milestones by state'
description: 'Filter milestones by state.'
argument :title, GraphQL::STRING_TYPE,
required: false,
description: 'The title of the milestone'
description: 'The title of the milestone.'
argument :search_title, GraphQL::STRING_TYPE,
required: false,
description: 'A search string for the title'
description: 'A search string for the title.'
argument :containing_date, Types::TimeType,
required: false,
description: 'A date that the milestone contains'
description: 'A date that the milestone contains.'
type Types::MilestoneType.connection_type, null: true
......
......@@ -5,17 +5,17 @@ module Resolvers
argument :include_subgroups, GraphQL::BOOLEAN_TYPE,
required: false,
default_value: false,
description: 'Include also subgroup projects'
description: 'Include also subgroup projects.'
argument :search, GraphQL::STRING_TYPE,
required: false,
default_value: nil,
description: 'Search project with most similar names or paths'
description: 'Search project with most similar names or paths.'
argument :sort, Types::Projects::NamespaceProjectSortEnum,
required: false,
default_value: nil,
description: 'Sort projects by this criteria'
description: 'Sort projects by this criteria.'
type Types::ProjectType, null: true
......
......@@ -6,7 +6,7 @@ module Resolvers
authorize :read_project_member
argument :relations, [Types::ProjectMemberRelationEnum],
description: 'Filter members by the given member relations',
description: 'Filter members by the given member relations.',
required: false,
default_value: MembersFinder::DEFAULT_RELATIONS
......
......@@ -5,7 +5,7 @@ module Resolvers
class ProjectMilestonesResolver < MilestonesResolver
argument :include_ancestors, GraphQL::BOOLEAN_TYPE,
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."
type Types::MilestoneType.connection_type, null: true
......
......@@ -8,7 +8,7 @@ module Resolvers
argument :iid, GraphQL::ID_TYPE,
required: true,
description: 'IID of the Pipeline, e.g., "1"'
description: 'IID of the Pipeline, e.g., "1".'
def resolve(iid:)
BatchLoader::GraphQL.for(iid).batch(key: project) do |iids, loader, args|
......
......@@ -11,7 +11,7 @@ module Resolvers
argument :name,
GraphQL::STRING_TYPE,
required: false,
description: 'Project name or key'
description: 'Project name or key.'
def resolve(name: nil, **args)
authorize!(project)
......
......@@ -12,11 +12,11 @@ module Resolvers
argument :active,
GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Indicates if the service is active'
description: 'Indicates if the service is active.'
argument :type,
Types::Projects::ServiceTypeEnum,
required: false,
description: 'Class name of the service'
description: 'Class name of the service.'
alias_method :project, :object
......
......@@ -6,23 +6,23 @@ module Resolvers
argument :membership, GraphQL::BOOLEAN_TYPE,
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,
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],
required: false,
description: 'Filter projects by IDs'
description: 'Filter projects by IDs.'
argument :search_namespaces, GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Include namespace in project search'
description: 'Include namespace in project search.'
argument :sort, GraphQL::STRING_TYPE,
required: false,
description: 'Sort order of results'
description: 'Sort order of results.'
def resolve(**args)
ProjectsFinder
......
......@@ -6,7 +6,7 @@ module Resolvers
argument :tag_name, GraphQL::STRING_TYPE,
required: true,
description: 'The name of the tag associated to the release'
description: 'The name of the tag associated to the release.'
alias_method :project, :object
......
......@@ -6,7 +6,7 @@ module Resolvers
argument :sort, Types::ReleaseSortEnum,
required: false, default_value: :released_at_desc,
description: 'Sort releases by this criteria'
description: 'Sort releases by this criteria.'
alias_method :project, :object
......
......@@ -13,7 +13,7 @@ module Resolvers
argument :paths, [GraphQL::STRING_TYPE],
required: false,
description: 'Paths of the blobs'
description: 'Paths of the blobs.'
def resolve(**args)
authorize!(snippet)
......
......@@ -11,20 +11,20 @@ module Resolvers
argument :author_id, ::Types::GlobalIDType[::User],
required: false,
description: 'The ID of an author'
description: 'The ID of an author.'
argument :project_id, ::Types::GlobalIDType[::Project],
required: false,
description: 'The ID of a project'
description: 'The ID of a project.'
argument :type, Types::Snippets::TypeEnum,
required: false,
description: 'The type of snippet'
description: 'The type of snippet.'
argument :explore,
GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Explore personal snippets'
description: 'Explore personal snippets.'
def resolve(**args)
if args[:author_id].present? && args[:project_id].present?
......
......@@ -8,27 +8,27 @@ module Resolvers
argument :action, [Types::TodoActionEnum],
required: false,
description: 'The action to be filtered'
description: 'The action to be filtered.'
argument :author_id, [GraphQL::ID_TYPE],
required: false,
description: 'The ID of an author'
description: 'The ID of an author.'
argument :project_id, [GraphQL::ID_TYPE],
required: false,
description: 'The ID of a project'
description: 'The ID of a project.'
argument :group_id, [GraphQL::ID_TYPE],
required: false,
description: 'The ID of a group'
description: 'The ID of a group.'
argument :state, [Types::TodoStateEnum],
required: false,
description: 'The state of the todo'
description: 'The state of the todo.'
argument :type, [Types::TodoTargetEnum],
required: false,
description: 'The type of the todo'
description: 'The type of the todo.'
def resolve(**args)
return Todo.none unless current_user.present? && target.present?
......
......@@ -7,15 +7,15 @@ module Resolvers
argument :path, GraphQL::STRING_TYPE,
required: false,
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,
required: false,
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,
required: false,
default_value: false,
description: 'Used to get a recursive tree. Default is false'
description: 'Used to get a recursive tree. Default is false.'
alias_method :repository, :object
......
......@@ -8,11 +8,11 @@ module Resolvers
argument :id, Types::GlobalIDType[User],
required: false,
description: 'ID of the User'
description: 'ID of the User.'
argument :username, GraphQL::STRING_TYPE,
required: false,
description: 'Username of the User'
description: 'Username of the User.'
def ready?(id: nil, username: nil)
unless id.present? ^ username.present?
......
......@@ -6,7 +6,7 @@ module Resolvers
argument :search, GraphQL::STRING_TYPE,
required: false,
description: 'Search query'
description: 'Search query.'
alias_method :user, :object
......
......@@ -10,7 +10,7 @@ module Resolvers
argument :type, Types::Snippets::TypeEnum,
required: false,
description: 'The type of snippet'
description: 'The type of snippet.'
private
......
......@@ -9,13 +9,13 @@ module Resolvers
argument :ids, [GraphQL::ID_TYPE],
required: false,
description: 'List of user Global IDs'
description: 'List of user Global IDs.'
argument :usernames, [GraphQL::STRING_TYPE], required: false,
description: 'List of usernames'
description: 'List of usernames.'
argument :sort, Types::SortEnum,
description: 'Sort users by this criteria',
description: 'Sort users by this criteria.',
required: false,
default_value: :created_desc
......
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