examples/active_storage_loader.rb in graphql-batch-0.5.2 vs examples/active_storage_loader.rb in graphql-batch-0.5.3

- old
+ new

@@ -12,29 +12,29 @@ # has_one_attached :image # has_many_attached :pictures # end #### -# An example data type using the AttachmentLoader +# An example data type using the Loaders::ActiveStorageLoader #### # class Types::EventType < Types::BaseObject # graphql_name 'Event' # # field :id, ID, null: false # field :image, String, null: true # field :pictures, String, null: true # # def image -# AttachmentLoader.for(:Event, :image).load(object.id).then do |image| +# Loaders::ActiveStorageLoader.for(:Event, :image).load(object.id).then do |image| # Rails.application.routes.url_helpers.url_for( # image.variant({ quality: 75 }) # ) # end # end # # def pictures -# AttachmentLoader.for(:Event, :pictures, association_type: :has_many_attached).load(object.id).then do |pictures| +# Loaders::ActiveStorageLoader.for(:Event, :pictures, association_type: :has_many_attached).load(object.id).then do |pictures| # pictures.map do |picture| # Rails.application.routes.url_helpers.url_for( # picture.variant({ quality: 75 }) # ) # end