module GraphQL::Autoload
See GraphQL::Railtie for automatic Rails integration
Public Instance Methods
# File lib/graphql/autoload.rb, line 23 def autoload(const_name, path) @_eagerloaded_constants ||= [] @_eagerloaded_constants << const_name super const_name, path end
Register a constant named const_name to be loaded from path. This is like Kernel#autoload but it tracks the constants so they can be eager-loaded with eager load!
Parameters
-
const_name(Symbol) -
path(String)
Returns
-
void
Calls superclass method
Source
# File lib/graphql/autoload.rb, line 38 def eager_load! @_eager_loading = true if @_eagerloaded_constants @_eagerloaded_constants.each { |const_name| const_get(const_name) } @_eagerloaded_constants = nil end nil ensure @_eager_loading = false end
Call this to load this constantโs autoload dependents and continue calling recursively
Returns
-
void