-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rails 6 support #27
Comments
I tried to do so (forked it and update dependencies). Sadly because of rails/rails#36638 it's not possible for now |
While for now, I figured it out with : # frozen_string_literal: true
module Extensions
class OrderedExtension < BaseExtension
DEFAULT_SCOPE = :ordered
def after_resolve(value:, **_)
scope = options.fetch(:scope, DEFAULT_SCOPE)
value&.send(scope)
end
end
end class myType < BaseType
# ...
field :has_many_stuffs, [StuffType], preload: [:whatever], extensions: [Extensions::OrderedExtension]
field :has_many_other_stuffs, [StuffType], preload: [:whatever] do
extension(Extensions::RoundedExtension, scope: :active)
end
|
FYI @ngouy in your fork the ActiveRecord dependency change is too restrictive- currently I removed the upper bound here which allows updating Rails minor versions again: https://github.com/Popmenu/graphql-preload/commit/5499986aad1cf07d9db897dcdb5846068bd0cd43 |
nice catch. Fixed |
Here is workaround for changed ActiveRecord's preloading by my colleagues: Here I adopted it to my fork: Envek@e868b8d (@ngouy, feel free to cherry-pick it to yours). I tested it with my micro test suite from #14 and in my project's branch for Rails 6 upgrade and it works. |
Preloading seems to be fixed in latest Rails 6 (will be released in 6.0.4) and master: rails/rails#40056 |
right now rails 6 is excluded here, are there plans to test compatibility out?
The text was updated successfully, but these errors were encountered: