Commit 78d31577 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix GraphQL docs classes

When eager loading the app in production, this fails because it expects
these files to define their respective classes.

We just skip these files from the autoloader and require them manually
for now
parent c75e2f81
......@@ -10,6 +10,9 @@ Rails.autoloaders.each do |autoloader|
# Mailer previews are also loaded manually by Rails
autoloader.ignore(Rails.root.join('app/mailers/previews'))
autoloader.ignore(Rails.root.join('ee/app/mailers/previews')) if Gitlab.ee?
# Ignore these files because these are only used in Rake tasks
# and are not available in production
autoloader.ignore(Rails.root.join('lib/gitlab/graphql/docs'))
autoloader.inflector.inflect(
'api' => 'API',
......
# frozen_string_literal: true
return if Rails.env.production?
module Gitlab
module Graphql
module Docs
......
# frozen_string_literal: true
return if Rails.env.production?
require 'gitlab/graphql/docs/helper'
module Gitlab
module Graphql
......
......@@ -3,6 +3,7 @@
return if Rails.env.production?
require 'graphql/rake_task'
require 'gitlab/graphql/docs/renderer'
namespace :gitlab do
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference")
......
# frozen_string_literal: true
require 'spec_helper'
require 'gitlab/graphql/docs/renderer'
describe Gitlab::Graphql::Docs::Renderer do
describe '#contents' do
......
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