{"action":"created","issue":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/81","labels_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/81/comments","events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/81/events","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/81","id":125514798,"number":81,"title":"Query::Arguments#to_h may return nested Arguments objects","user":{"login":"kliuless","id":307761,"avatar_url":"https://avatars.githubusercontent.com/u/307761?v=3","gravatar_id":"","url":"https://api.github.com/users/kliuless","html_url":"https://github.com/kliuless","followers_url":"https://api.github.com/users/kliuless/followers","following_url":"https://api.github.com/users/kliuless/following{/other_user}","gists_url":"https://api.github.com/users/kliuless/gists{/gist_id}","starred_url":"https://api.github.com/users/kliuless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kliuless/subscriptions","organizations_url":"https://api.github.com/users/kliuless/orgs","repos_url":"https://api.github.com/users/kliuless/repos","events_url":"https://api.github.com/users/kliuless/events{/privacy}","received_events_url":"https://api.github.com/users/kliuless/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-08T00:20:33Z","updated_at":"2016-01-08T13:49:05Z","closed_at":null,"body":"I have a mutation that accepts an input_field `a`, which is an input object type with a field `b`.\r\nIn the mutation resolver, the inputs argument is something like this:\r\n```\r\n#<GraphQL::Query::Arguments:0x007f993d572aa0\r\n @hash={\"a\"=>#<GraphQL::Query::Arguments:0x007f993d572960 @hash={\"b\"=>5}, @values={\"b\"=>5}>},\r\n @values={\"a\"=>#<GraphQL::Query::Arguments:0x007f993d572960 @hash={\"b\"=>5}, @values={\"b\"=>5}>}>\r\n```\r\ncalling `to_h` on it merely returns `@hash`, so I need to call `to_h` at every depth.\r\n\r\nWhen calling `Arguments.new` on a nested hash, it recursively creates `Arguments` objects when setting `@value`, but the original is retained in `@hash`.\r\nHowever when handling a real request, even the `@hash` has nested `Arguments` objects.\r\nIs there some built-in way to unpack the `Arguments` recursively?"},"comment":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/comments/170008159","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/81#issuecomment-170008159","issue_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/81","id":170008159,"user":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars.githubusercontent.com/u/2231765?v=3","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":false},"created_at":"2016-01-08T13:49:05Z","updated_at":"2016-01-08T13:49:05Z","body":"No built-in way, but +1 for recursive `to_h`-ing!"}}