Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ee60128c
Commit
ee60128c
authored
Jan 31, 2019
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add argument iids to IssuesResolver
parent
04554d69
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
app/graphql/resolvers/issues_resolver.rb
app/graphql/resolvers/issues_resolver.rb
+4
-0
changelogs/unreleased/57063-implement-new-arguments-iid-for-issuesresolver-in-graphql.yml
...ement-new-arguments-iid-for-issuesresolver-in-graphql.yml
+5
-0
spec/graphql/resolvers/issues_resolver_spec.rb
spec/graphql/resolvers/issues_resolver_spec.rb
+20
-0
No files found.
app/graphql/resolvers/issues_resolver.rb
View file @
ee60128c
...
...
@@ -4,6 +4,10 @@ module Resolvers
class
IssuesResolver
<
BaseResolver
extend
ActiveSupport
::
Concern
argument
:iids
,
[
GraphQL
::
ID_TYPE
],
required:
false
,
description:
'The list of IIDs of issues, e.g., [1, 2]'
argument
:search
,
GraphQL
::
STRING_TYPE
,
required:
false
argument
:sort
,
Types
::
Sort
,
...
...
changelogs/unreleased/57063-implement-new-arguments-iid-for-issuesresolver-in-graphql.yml
0 → 100644
View file @
ee60128c
---
title
:
Add argument iids for issues in GraphQL
merge_request
:
24802
author
:
type
:
added
spec/graphql/resolvers/issues_resolver_spec.rb
View file @
ee60128c
...
...
@@ -32,6 +32,26 @@ describe Resolvers::IssuesResolver do
expect
(
resolve_issues
).
to
contain_exactly
(
issue
,
issue2
)
end
it
'finds a specific issue with iids'
do
expect
(
resolve_issues
(
iids:
issue
.
iid
)).
to
contain_exactly
(
issue
)
end
it
'finds multiple issues with iids'
do
expect
(
resolve_issues
(
iids:
[
issue
.
iid
,
issue2
.
iid
]))
.
to
contain_exactly
(
issue
,
issue2
)
end
it
'finds only the issues within the project we are looking at'
do
another_project
=
create
(
:project
)
iids
=
[
issue
,
issue2
].
map
(
&
:iid
)
iids
.
each
do
|
iid
|
create
(
:issue
,
project:
another_project
,
iid:
iid
)
end
expect
(
resolve_issues
(
iids:
iids
)).
to
contain_exactly
(
issue
,
issue2
)
end
end
def
resolve_issues
(
args
=
{},
context
=
{
current_user:
current_user
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment