Class: GraphqlPreloadQueries::Extensions::Preload
- Inherits:
-
GraphQL::Schema::FieldExtension
- Object
- GraphQL::Schema::FieldExtension
- GraphqlPreloadQueries::Extensions::Preload
- Defined in:
- lib/graphql_preload_queries/extensions/preload.rb
Class Method Summary collapse
-
.preload_associations(value, node, type_klass) ⇒ Object
Add all the corresponding preloads to the collection.
Class Method Details
.preload_associations(value, node, type_klass) ⇒ Object
Add all the corresponding preloads to the collection
14 15 16 17 18 19 |
# File 'lib/graphql_preload_queries/extensions/preload.rb', line 14 def preload_associations(value, node, type_klass) preloads = filter_preloads(node, type_klass.preloads || {}) log_info = { type_klass: type_klass, preloads: preloads, configured: type_klass.preloads } GraphqlPreloadQueries.log("Preloading: #{log_info}") apply_preloads(value, preloads) end |