diff --git a/lib/graphql.rb b/lib/graphql.rb index e2824ad19e..17eb3ed363 100644 --- a/lib/graphql.rb +++ b/lib/graphql.rb @@ -15,6 +15,7 @@ def self.eager_load! super Query.eager_load! Types.eager_load! + Schema.eager_load! end class Error < StandardError diff --git a/lib/graphql/schema.rb b/lib/graphql/schema.rb index a1963a0449..4c558023ba 100644 --- a/lib/graphql/schema.rb +++ b/lib/graphql/schema.rb @@ -75,6 +75,9 @@ module GraphQL class Schema extend GraphQL::Schema::Member::HasAstNode extend GraphQL::Schema::FindInheritedValue + extend Autoload + + autoload :BUILT_IN_TYPES, "graphql/schema/built_in_types" class DuplicateNamesError < GraphQL::Error attr_reader :duplicated_name @@ -1805,6 +1808,5 @@ module DefaultTraceClass end end -require "graphql/schema/built_in_types" require "graphql/schema/loader" require "graphql/schema/printer"