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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
0cedd43e
Commit
0cedd43e
authored
Jun 05, 2019
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grab field_defn to access certain values
parent
95b3fe28
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
app/graphql/types/base_field.rb
app/graphql/types/base_field.rb
+4
-2
No files found.
app/graphql/types/base_field.rb
View file @
0cedd43e
...
...
@@ -32,9 +32,11 @@ module Types
# Resolvers may add extra complexity depending on used arguments
complexity
=
child_complexity
+
self
.
resolver
&
.
try
(
:resolver_complexity
,
args
,
child_complexity:
child_complexity
).
to_i
if
@connection
field_defn
=
to_graphql
if
field_defn
.
connection?
# Resolvers may add extra complexity depending on number of items being loaded.
page_size
=
@
max_page_size
||
ctx
.
schema
.
default_max_page_size
page_size
=
field_defn
.
connection_
max_page_size
||
ctx
.
schema
.
default_max_page_size
limit_value
=
[
args
[
:first
],
args
[
:last
],
page_size
].
compact
.
min
multiplier
=
self
.
resolver
&
.
try
(
:complexity_multiplier
,
args
).
to_f
complexity
+=
complexity
*
limit_value
*
multiplier
...
...
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