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
af2be4e9
Commit
af2be4e9
authored
Feb 02, 2021
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace IterationsResolver with IterationsFinder
parent
35a2f4c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
ee/app/graphql/mutations/iterations/update.rb
ee/app/graphql/mutations/iterations/update.rb
+6
-5
No files found.
ee/app/graphql/mutations/iterations/update.rb
View file @
af2be4e9
...
...
@@ -55,7 +55,7 @@ module Mutations
response
=
::
Iterations
::
UpdateService
.
new
(
parent
,
current_user
,
args
).
execute
(
iteration
)
response_object
=
response
.
payload
[
:iteration
]
if
response
.
success?
response_object
=
response
.
success?
?
response
.
payload
[
:iteration
]
:
nil
response_errors
=
response
.
error?
?
(
response
.
payload
[
:errors
]
||
response
.
message
)
:
[]
{
...
...
@@ -67,8 +67,9 @@ module Mutations
private
def
find_object
(
parent
:,
id
:)
::
Resolvers
::
IterationsResolver
.
new
(
object:
parent
,
context:
context
,
field:
nil
)
.
resolve
(
id:
id
).
first
params
=
IterationsFinder
.
params_for_parent
(
parent
).
merge!
(
id:
id
)
IterationsFinder
.
new
(
context
[
:current_user
],
params
).
execute
.
first
end
def
validate_arguments!
(
args
)
...
...
@@ -78,9 +79,9 @@ module Mutations
# Originally accepted a raw model id. Now accept a gid, but allow a raw id
# for backward compatibility
def
id_from_args
(
args
)
GitlabSchema
.
parse_gid
(
args
[
:id
],
expected_type:
::
Iteration
)
GitlabSchema
.
parse_gid
(
args
[
:id
],
expected_type:
::
Iteration
)
.
model_id
rescue
Gitlab
::
Graphql
::
Errors
::
ArgumentError
::
Gitlab
::
GlobalId
.
as_global_id
(
args
[
:id
].
to_i
,
model_name:
'Iteration'
)
args
[
:id
].
to_i
end
end
end
...
...
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