github-community-projects / graphql-client

A Ruby library for declaring, composing and executing GraphQL queries
MIT License
42 stars 218 forks source link

add to_hash alias to to_h method of ObjectType and Response #16

Closed ElvinEfendi closed 8 months ago

ElvinEfendi commented 8 months ago

In Rails, it's quite common to use as_json which relies on to_hash that graphql-client currently lacks. This PR introduces to_hash as an alias to to_h.

Ref: https://github.com/rails/rails/blob/3528b9df8b331863025c6ee66341b98d4989c40d/activesupport/lib/active_support/core_ext/object/json.rb#L59

rmosolgo commented 8 months ago

Looks good to me -- thanks for this improvement!