Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a lot of cases, GraphQL schema configurations can be automatically future-proofed. I'm hoping to write development utility to do this.
It will require moving some instance methods to class methods, and replacing the instance method body to a class method.
It would also be nice to have a clean-up method that removed the instance methods once they are unused
I think it will need access to the in-memory Schema definition. That would allow it to search for inherited methods.
hash_key:method:object.public_send(method_sym), it will work as written, no conversion requiredresolver_method:resolve_{each, batch, static}:class method. Calls methods on self or references to instance variables prevent auto-migration.resolve_eachmethod, but first choice is to have the owner audit the application and choose either hash key or method.resolver:,mutation:,subscription:extras:extensions:scope: trueandconnection: truein the gem?FutureStreamalso uses this. Can we useprependto intercept the method call? Field singleton classes have a dedicated::PreResolvemodule which contains these prepended methods? (This would create singleton classes for each field that uses it though, which is yuck, at least on old Ruby versions) Generate a method which calls theresolve_{each,batch,static}method?dig:connection:,scope:extensions:- not currently supportable but lots of possibilitiesdataload(...),dataload_record(...), anddataload_association(...)field :post, Types::PostType, dataload_assocation: true # or dataload_association: :post