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
91a2ceb4
Commit
91a2ceb4
authored
Nov 13, 2020
by
Luke Duncalfe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove monkeypatch of `resolve_field`
Now that we have updated the `graphql-ruby` gem version.
parent
0cd79ee8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
28 deletions
+0
-28
app/graphql/types/base_field.rb
app/graphql/types/base_field.rb
+0
-28
No files found.
app/graphql/types/base_field.rb
View file @
91a2ceb4
...
...
@@ -25,34 +25,6 @@ module Types
@requires_argument
||
arguments
.
values
.
any?
{
|
argument
|
argument
.
type
.
non_null?
}
end
# Based on https://github.com/rmosolgo/graphql-ruby/blob/v1.11.4/lib/graphql/schema/field.rb#L538-L563
# Modified to fix https://github.com/rmosolgo/graphql-ruby/issues/3113
def
resolve_field
(
obj
,
args
,
ctx
)
ctx
.
schema
.
after_lazy
(
obj
)
do
|
after_obj
|
query_ctx
=
ctx
.
query
.
context
inner_obj
=
after_obj
&
.
object
ctx
.
schema
.
after_lazy
(
to_ruby_args
(
after_obj
,
args
,
ctx
))
do
|
ruby_args
|
if
authorized?
(
inner_obj
,
ruby_args
,
query_ctx
)
if
@resolve_proc
# We pass `after_obj` here instead of `inner_obj` because extensions expect a GraphQL::Schema::Object
with_extensions
(
after_obj
,
ruby_args
,
query_ctx
)
do
|
extended_obj
,
extended_args
|
# Since `extended_obj` is now a GraphQL::Schema::Object, we need to get the inner object and pass that to `@resolve_proc`
extended_obj
=
extended_obj
.
object
if
extended_obj
.
is_a?
(
GraphQL
::
Schema
::
Object
)
@resolve_proc
.
call
(
extended_obj
,
args
,
ctx
)
end
else
public_send_field
(
after_obj
,
ruby_args
,
query_ctx
)
end
else
err
=
GraphQL
::
UnauthorizedFieldError
.
new
(
object:
inner_obj
,
type:
obj
.
class
,
context:
ctx
,
field:
self
)
query_ctx
.
schema
.
unauthorized_field
(
err
)
end
end
end
end
def
base_complexity
complexity
=
DEFAULT_COMPLEXITY
complexity
+=
1
if
calls_gitaly?
...
...
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