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
30b6b964
Commit
30b6b964
authored
Mar 29, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use is_ prefix on predicates
parent
d6c1509b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lib/gitlab/graphql/docs/helper.rb
lib/gitlab/graphql/docs/helper.rb
+7
-7
No files found.
lib/gitlab/graphql/docs/helper.rb
View file @
30b6b964
...
...
@@ -122,11 +122,11 @@ module Gitlab
# Methods that return parts of the schema, or related information:
def
connection_object_types
objects
.
select
{
|
t
|
t
[
:
edge
]
||
t
[
:
connection
]
}
objects
.
select
{
|
t
|
t
[
:
is_edge
]
||
t
[
:is_
connection
]
}
end
def
object_types
objects
.
reject
{
|
t
|
t
[
:
edge
]
||
t
[
:connection
]
||
t
[
:
payload
]
}
objects
.
reject
{
|
t
|
t
[
:
is_edge
]
||
t
[
:is_connection
]
||
t
[
:is_
payload
]
}
end
def
interfaces
...
...
@@ -273,10 +273,10 @@ module Gitlab
end
def
render_description_of
(
object
)
desc
=
if
object
[
:edge
]
desc
=
if
object
[
:
is_
edge
]
base
=
object
[
:name
].
chomp
(
'Edge'
)
"The edge type for [`
#{
base
}
`](#
#{
base
.
downcase
}
)."
elsif
object
[
:connection
]
elsif
object
[
:
is_
connection
]
base
=
object
[
:name
].
chomp
(
'Connection'
)
"The connection type for [`
#{
base
}
`](#
#{
base
.
downcase
}
)."
else
...
...
@@ -339,9 +339,9 @@ module Gitlab
.
map
do
|
type
|
name
=
type
[
:name
]
type
.
merge
(
edge:
name
.
ends_with?
(
'Edge'
),
connection:
name
.
ends_with?
(
'Connection'
),
payload:
name
.
ends_with?
(
'Payload'
)
&&
mutations
.
include?
(
name
.
chomp
(
'Payload'
).
camelcase
(
:lower
)),
is_
edge:
name
.
ends_with?
(
'Edge'
),
is_
connection:
name
.
ends_with?
(
'Connection'
),
is_
payload:
name
.
ends_with?
(
'Payload'
)
&&
mutations
.
include?
(
name
.
chomp
(
'Payload'
).
camelcase
(
:lower
)),
fields:
type
[
:fields
]
+
type
[
:connections
]
)
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