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
28e7d8c2
Commit
28e7d8c2
authored
Nov 17, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use BaseEdge in schema
parent
2cab4268
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
app/graphql/types/base_object.rb
app/graphql/types/base_object.rb
+1
-0
app/graphql/types/ci/runner_web_url_edge.rb
app/graphql/types/ci/runner_web_url_edge.rb
+1
-1
ee/spec/requests/api/graphql/project/pipelines/dast_profile_spec.rb
...quests/api/graphql/project/pipelines/dast_profile_spec.rb
+1
-1
spec/support/helpers/graphql_helpers.rb
spec/support/helpers/graphql_helpers.rb
+4
-2
No files found.
app/graphql/types/base_object.rb
View file @
28e7d8c2
...
...
@@ -7,6 +7,7 @@ module Types
prepend
Gitlab
::
Graphql
::
MarkdownField
field_class
Types
::
BaseField
edge_type_class
Types
::
BaseEdge
def
self
.
accepts
(
*
types
)
@accepts
||=
[]
...
...
app/graphql/types/ci/runner_web_url_edge.rb
View file @
28e7d8c2
...
...
@@ -3,7 +3,7 @@
module
Types
module
Ci
# rubocop: disable Graphql/AuthorizeTypes
class
RunnerWebUrlEdge
<
GraphQL
::
Types
::
Relay
::
BaseEdge
class
RunnerWebUrlEdge
<
::
Types
::
BaseEdge
include
FindClosest
field
:web_url
,
GraphQL
::
Types
::
String
,
null:
true
,
...
...
ee/spec/requests/api/graphql/project/pipelines/dast_profile_spec.rb
View file @
28e7d8c2
...
...
@@ -85,7 +85,7 @@ RSpec.describe 'Query.project(fullPath).pipelines.dastProfile' do
subject
expect
(
dast_profile_data
).
to
be_empty
expect
(
dast_profile_data
).
to
contain_exactly
(
nil
)
end
end
end
...
...
spec/support/helpers/graphql_helpers.rb
View file @
28e7d8c2
...
...
@@ -514,8 +514,10 @@ module GraphqlHelpers
# Allows for array indexing, like this
# ['project', 'boards', 'edges', 0, 'node', 'lists']
keys
.
reduce
(
data
)
do
|
memo
,
key
|
if
memo
.
is_a?
(
Array
)
key
.
is_a?
(
Integer
)
?
memo
[
key
]
:
memo
.
compact
.
flat_map
do
|
e
|
if
memo
.
is_a?
(
Array
)
&&
key
.
is_a?
(
Integer
)
memo
[
key
]
elsif
memo
.
is_a?
(
Array
)
memo
.
compact
.
flat_map
do
|
e
|
x
=
e
[
key
]
x
.
nil?
?
[
x
]
:
Array
.
wrap
(
x
)
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