Skip to content
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

Fix some hash lookup behaviors #4072

Merged
merged 11 commits into from May 24, 2022
Merged

Fix some hash lookup behaviors #4072

merged 11 commits into from May 24, 2022

Conversation

rmosolgo
Copy link
Owner

Fixes #4059
Fixes #4068

@rmosolgo rmosolgo added this to the 2.0.8 milestone May 24, 2022
@alexcwatt
Copy link

@rmosolgo I found this PR from the changelog which mentions this PR as where

Support hash_key: lookups on Hash-like objects #4072

This is an awesome improvement!

I have a project still on 1.x and was wondering if you would consider backporting hash_key lookups on non-Hash objects there? Specifically I have an ActiveRecord object where I'd like to be able to use hash_key.

I think the relevant code in 1.x is here (hash_key only works for Hash objects):
https://github.com/rmosolgo/graphql-ruby/blob/v1.13.17/lib/graphql/schema/field.rb#L838-L846

vs in 2.x where non-Hash objects are also supported:
https://github.com/rmosolgo/graphql-ruby/blob/v2.0.16/lib/graphql/schema/field.rb#L669-L675

I'm not sure that all the enhancements for hash_key are in this PR, but I think the linked bits of code above are relevant.

@rmosolgo
Copy link
Owner Author

👋 Hey @alexcwatt, I'd be happy to try to backport the behaviors you're looking for. I got started over in #4286, will that cover it for you? Please let me know more details on the PR if there's something else you have in mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants