Commit 70f5a5b0 authored by charlieablett's avatar charlieablett

Add GraphQL schema EE concern

Remove constants class from spec_helper
parent c0749f85
...@@ -28,8 +28,6 @@ class GitlabSchema < GraphQL::Schema ...@@ -28,8 +28,6 @@ class GitlabSchema < GraphQL::Schema
default_max_page_size 100 default_max_page_size 100
lazy_resolve ::Epics::LazyEpicAggregate, :epic_aggregate
class << self class << self
def multiplex(queries, **kwargs) def multiplex(queries, **kwargs)
kwargs[:max_complexity] ||= max_query_complexity(kwargs[:context]) kwargs[:max_complexity] ||= max_query_complexity(kwargs[:context])
...@@ -143,3 +141,5 @@ class GitlabSchema < GraphQL::Schema ...@@ -143,3 +141,5 @@ class GitlabSchema < GraphQL::Schema
end end
end end
end end
GitlabSchema.prepend_if_ee('EE::GitlabSchema')
# frozen_string_literal: true
module EE
module GitlabSchema
extend ActiveSupport::Concern
prepended do
lazy_resolve ::Epics::LazyEpicAggregate, :epic_aggregate
end
end
end
# frozen_string_literal: true # frozen_string_literal: true
describe Epics::Aggregate do describe Epics::Aggregate do
let(:epic_type) { described_class::EPIC_TYPE } let(:epic_type) { described_class::EPIC_TYPE }
let(:issue_type) { described_class::ISSUE_TYPE } let(:issue_type) { described_class::ISSUE_TYPE }
...@@ -13,6 +12,10 @@ describe Epics::Aggregate do ...@@ -13,6 +12,10 @@ describe Epics::Aggregate do
let(:weight_sum) { Epics::EpicNode::WEIGHT_SUM } let(:weight_sum) { Epics::EpicNode::WEIGHT_SUM }
let(:count) { Epics::EpicNode::COUNT } let(:count) { Epics::EpicNode::COUNT }
class Constants
include ::Epics::AggregateConstants
end
context 'when CountAggregate' do context 'when CountAggregate' do
subject { Epics::CountAggregate.new(sums) } subject { Epics::CountAggregate.new(sums) }
......
...@@ -276,7 +276,3 @@ Rugged::Settings['search_path_global'] = Rails.root.join('tmp/tests').to_s ...@@ -276,7 +276,3 @@ Rugged::Settings['search_path_global'] = Rails.root.join('tmp/tests').to_s
# Disable timestamp checks for invisible_captcha # Disable timestamp checks for invisible_captcha
InvisibleCaptcha.timestamp_enabled = false InvisibleCaptcha.timestamp_enabled = false
class Constants
include Epics::AggregateConstants
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