Commit 28e7d8c2 authored by Alex Kalderimis's avatar Alex Kalderimis

Use BaseEdge in schema

parent 2cab4268
......@@ -7,6 +7,7 @@ module Types
prepend Gitlab::Graphql::MarkdownField
field_class Types::BaseField
edge_type_class Types::BaseEdge
def self.accepts(*types)
@accepts ||= []
......
......@@ -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,
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment