Commit c7b833b2 authored by James Fargher's avatar James Fargher

Merge branch '328240-add-negated-issue-type-to-issue-resolver' into 'master'

Allow issue resolver to filter by negated issueType in GraphQL

See merge request gitlab-org/gitlab!70635
parents af9e7094 4cca803a
......@@ -29,6 +29,10 @@ module Types
argument :my_reaction_emoji, GraphQL::Types::String,
required: false,
description: 'Filter by reaction emoji applied by the current user.'
argument :types, [Types::IssueTypeEnum],
as: :issue_types,
description: 'Filters out issues by the given issue types.',
required: false
end
end
end
......
......@@ -17906,6 +17906,7 @@ Represents an escalation rule.
| <a id="negatedissuefilterinputmilestonetitle"></a>`milestoneTitle` | [`[String!]`](#string) | Milestone not applied to this issue. |
| <a id="negatedissuefilterinputmilestonewildcardid"></a>`milestoneWildcardId` | [`NegatedMilestoneWildcardId`](#negatedmilestonewildcardid) | Filter by negated milestone wildcard values. |
| <a id="negatedissuefilterinputmyreactionemoji"></a>`myReactionEmoji` | [`String`](#string) | Filter by reaction emoji applied by the current user. |
| <a id="negatedissuefilterinputtypes"></a>`types` | [`[IssueType!]`](#issuetype) | Filters out issues by the given issue types. |
| <a id="negatedissuefilterinputweight"></a>`weight` | [`String`](#string) | Weight not applied to the issue. |
### `OncallRotationActivePeriodInputType`
......
......@@ -290,6 +290,10 @@ RSpec.describe Resolvers::IssuesResolver do
expect(resolve_issues(not: { assignee_id: [assignee.id] })).to contain_exactly(issue1)
end
it 'returns issues without the specified issue_type' do
expect(resolve_issues(not: { types: ['issue'] })).to contain_exactly(issue1)
end
context 'when filtering by negated author' do
let_it_be(:issue_by_reporter) { create(:issue, author: reporter, project: project, state: :opened) }
......@@ -525,6 +529,12 @@ RSpec.describe Resolvers::IssuesResolver do
expect(result).to contain_exactly(issue1, issue2, issue3)
end
it 'returns issues without the specified issue_type' do
result = resolve(described_class, obj: group, ctx: { current_user: current_user }, args: { not: { types: ['issue'] } })
expect(result).to contain_exactly(issue1)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment