Skip to content

Commit

Permalink
Fix autoloading of GraphQL::Types
Browse files Browse the repository at this point in the history
Types reference schema, which reference types, so we need to take the
part of schema that reference types, and autoload it.
  • Loading branch information
gmcgibbon committed Dec 4, 2024
1 parent 904c4d4 commit d3e1010
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/graphql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def self.eager_load!
super
Query.eager_load!
Types.eager_load!
Schema.eager_load!
end

class Error < StandardError
Expand Down
4 changes: 3 additions & 1 deletion lib/graphql/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1805,6 +1808,5 @@ module DefaultTraceClass
end
end

require "graphql/schema/built_in_types"
require "graphql/schema/loader"
require "graphql/schema/printer"

0 comments on commit d3e1010

Please sign in to comment.