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
2ad30bac
Commit
2ad30bac
authored
Mar 02, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more explicit code comment
parent
540877d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
spec/support/helpers/graphql_helpers.rb
spec/support/helpers/graphql_helpers.rb
+4
-1
No files found.
spec/support/helpers/graphql_helpers.rb
View file @
2ad30bac
...
...
@@ -42,6 +42,7 @@ module GraphqlHelpers
field
=
::
Types
::
BaseField
.
new
(
**
field_options
)
# All mutations accept a single `:input` argument. Wrap arguments here.
# See the unwrapping below in GraphqlHelpers#resolve_field
args
=
{
input:
args
}
if
resolver_class
<=
::
Mutations
::
BaseMutation
&&
!
args
.
key?
(
:input
)
resolve_field
(
field
,
obj
,
...
...
@@ -115,7 +116,9 @@ module GraphqlHelpers
# TODO: This will need to change when we move to the interpreter - at that
# point we will call `field#resolve`
# hack alert
# Unwrap the arguments to mutations. This pairs with the wrapping in GraphqlHelpers#resolve
# If arguments are not wrapped first, then arguments processing will raise.
# If arguments are not unwrapped here, then the resolve method of the mutation will raise argument errors.
arguments
=
arguments
.
to_kwargs
[
:input
]
if
field
.
resolver
&&
field
.
resolver
<=
::
Mutations
::
BaseMutation
field
.
resolve_field
(
parent
,
arguments
,
query_ctx
)
...
...
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