diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /app/graphql/resolvers | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'app/graphql/resolvers')
10 files changed, 41 insertions, 18 deletions
diff --git a/app/graphql/resolvers/base_issues_resolver.rb b/app/graphql/resolvers/base_issues_resolver.rb index 3983a3697cb..3e7509b4068 100644 --- a/app/graphql/resolvers/base_issues_resolver.rb +++ b/app/graphql/resolvers/base_issues_resolver.rb @@ -48,7 +48,8 @@ module Resolvers labels: [:labels], assignees: [:assignees], timelogs: [:timelogs], - customer_relations_contacts: { customer_relations_contacts: [:group] } + customer_relations_contacts: { customer_relations_contacts: [:group] }, + escalation_status: [:incident_management_issuable_escalation_status] } end diff --git a/app/graphql/resolvers/ci/config_resolver.rb b/app/graphql/resolvers/ci/config_resolver.rb index 2d74392a84c..387185b5171 100644 --- a/app/graphql/resolvers/ci/config_resolver.rb +++ b/app/graphql/resolvers/ci/config_resolver.rb @@ -47,11 +47,13 @@ module Resolvers { status: :valid, errors: [], + warnings: result.warnings, stages: make_stages(result.jobs) } else { status: :invalid, + warnings: result.warnings, errors: result.errors } end diff --git a/app/graphql/resolvers/clusters/agent_tokens_resolver.rb b/app/graphql/resolvers/clusters/agent_tokens_resolver.rb index 5ae19700fd5..8208fa56485 100644 --- a/app/graphql/resolvers/clusters/agent_tokens_resolver.rb +++ b/app/graphql/resolvers/clusters/agent_tokens_resolver.rb @@ -9,10 +9,17 @@ module Resolvers delegate :project, to: :agent + argument :status, Types::Clusters::AgentTokenStatusEnum, + required: false, + description: 'Status of the token.' + def resolve(**args) return ::Clusters::AgentToken.none unless can_read_agent_tokens? - agent.last_used_agent_tokens + tokens = agent.last_used_agent_tokens + tokens = tokens.with_status(args[:status]) if args[:status].present? + + tokens end private diff --git a/app/graphql/resolvers/concerns/resolves_pipelines.rb b/app/graphql/resolvers/concerns/resolves_pipelines.rb index 1c01e5e0250..42c4c22a938 100644 --- a/app/graphql/resolvers/concerns/resolves_pipelines.rb +++ b/app/graphql/resolvers/concerns/resolves_pipelines.rb @@ -24,7 +24,7 @@ module ResolvesPipelines argument :source, GraphQL::Types::String, required: false, - description: "Filter pipelines by their source. Will be ignored if `dast_view_scans` feature flag is disabled." + description: "Filter pipelines by their source." end class_methods do @@ -38,8 +38,6 @@ module ResolvesPipelines end def resolve_pipelines(project, params = {}) - params.delete(:source) unless Feature.enabled?(:dast_view_scans, project, default_enabled: :yaml) - Ci::PipelinesFinder.new(project, context[:current_user], params).execute end end diff --git a/app/graphql/resolvers/design_management/version/designs_at_version_resolver.rb b/app/graphql/resolvers/design_management/version/designs_at_version_resolver.rb index 254f1efa0a5..97cc7554ba8 100644 --- a/app/graphql/resolvers/design_management/version/designs_at_version_resolver.rb +++ b/app/graphql/resolvers/design_management/version/designs_at_version_resolver.rb @@ -13,13 +13,13 @@ module Resolvers DesignID = ::Types::GlobalIDType[::DesignManagement::Design] - argument :ids, [DesignID], - required: false, - description: 'Filters designs by their ID.' argument :filenames, [GraphQL::Types::String], required: false, description: 'Filters designs by their filename.' + argument :ids, [DesignID], + required: false, + description: 'Filters designs by their ID.' def self.single ::Resolvers::DesignManagement::Version::DesignAtVersionResolver diff --git a/app/graphql/resolvers/design_management/version_in_collection_resolver.rb b/app/graphql/resolvers/design_management/version_in_collection_resolver.rb index 80db15755d3..2682ce6b3b1 100644 --- a/app/graphql/resolvers/design_management/version_in_collection_resolver.rb +++ b/app/graphql/resolvers/design_management/version_in_collection_resolver.rb @@ -15,13 +15,13 @@ module Resolvers VersionID = ::Types::GlobalIDType[::DesignManagement::Version] - argument :sha, GraphQL::Types::String, - required: false, - description: "SHA256 of a specific version." argument :id, VersionID, as: :version_id, required: false, description: 'Global ID of the version.' + argument :sha, GraphQL::Types::String, + required: false, + description: "SHA256 of a specific version." def resolve(version_id: nil, sha: nil) # TODO: remove this line when the compatibility layer is removed diff --git a/app/graphql/resolvers/group_milestones_resolver.rb b/app/graphql/resolvers/group_milestones_resolver.rb index 44192b6f4bf..319ff9f68c4 100644 --- a/app/graphql/resolvers/group_milestones_resolver.rb +++ b/app/graphql/resolvers/group_milestones_resolver.rb @@ -2,12 +2,12 @@ module Resolvers class GroupMilestonesResolver < MilestonesResolver - argument :include_descendants, GraphQL::Types::Boolean, - required: false, - description: 'Include milestones from all subgroups and subprojects.' argument :include_ancestors, GraphQL::Types::Boolean, required: false, description: 'Include milestones from all parent groups.' + argument :include_descendants, GraphQL::Types::Boolean, + required: false, + description: 'Include milestones from all subgroups and subprojects.' type Types::MilestoneType.connection_type, null: true diff --git a/app/graphql/resolvers/merge_requests_resolver.rb b/app/graphql/resolvers/merge_requests_resolver.rb index bd7f1f0774e..6dbcbe0e04d 100644 --- a/app/graphql/resolvers/merge_requests_resolver.rb +++ b/app/graphql/resolvers/merge_requests_resolver.rb @@ -51,6 +51,10 @@ module Resolvers required: false, description: 'Merge request state. If provided, all resolved merge requests will have this state.' + argument :draft, GraphQL::Types::Boolean, + required: false, + description: 'Limit result to draft merge requests.' + argument :labels, [GraphQL::Types::String], required: false, as: :label_name, diff --git a/app/graphql/resolvers/users/groups_resolver.rb b/app/graphql/resolvers/users/groups_resolver.rb index eafb56d8f4c..d8492a8fcf9 100644 --- a/app/graphql/resolvers/users/groups_resolver.rb +++ b/app/graphql/resolvers/users/groups_resolver.rb @@ -23,10 +23,6 @@ module Resolvers Preloaders::GroupPolicyPreloader.new(nodes, current_user).execute end - def ready?(**args) - Feature.enabled?(:paginatable_namespace_drop_down_for_project_creation, current_user, default_enabled: :yaml) - end - private def resolve_groups(**args) diff --git a/app/graphql/resolvers/work_items/types_resolver.rb b/app/graphql/resolvers/work_items/types_resolver.rb new file mode 100644 index 00000000000..b7a32e13423 --- /dev/null +++ b/app/graphql/resolvers/work_items/types_resolver.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Resolvers + module WorkItems + class TypesResolver < BaseResolver + type Types::WorkItems::TypeType.connection_type, null: true + + def resolve + # This will require a finder in the future when groups/projects get their work item types + # All groups/projects use the default types for now + ::WorkItems::Type.default.order_by_name_asc + end + end + end +end |