{"action":"created","issue":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1447","repository_url":"https://api.github.com/repos/rmosolgo/graphql-ruby","labels_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1447/labels{/name}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1447/comments","events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1447/events","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/1447","id":317281407,"node_id":"MDU6SXNzdWUzMTcyODE0MDc=","number":1447,"title":"[1.8] Field level testing broken in class based API","user":{"login":"bessey","id":708200,"node_id":"MDQ6VXNlcjcwODIwMA==","avatar_url":"https://avatars2.githubusercontent.com/u/708200?v=4","gravatar_id":"","url":"https://api.github.com/users/bessey","html_url":"https://github.com/bessey","followers_url":"https://api.github.com/users/bessey/followers","following_url":"https://api.github.com/users/bessey/following{/other_user}","gists_url":"https://api.github.com/users/bessey/gists{/gist_id}","starred_url":"https://api.github.com/users/bessey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bessey/subscriptions","organizations_url":"https://api.github.com/users/bessey/orgs","repos_url":"https://api.github.com/users/bessey/repos","events_url":"https://api.github.com/users/bessey/events{/privacy}","received_events_url":"https://api.github.com/users/bessey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-24T15:33:16Z","updated_at":"2018-06-26T14:02:18Z","closed_at":null,"author_association":"NONE","body":"We do a fair amount of [field level testing](http://graphql-ruby.org/schema/testing.html#fields). It appears that given a type\r\n\r\n```ruby\r\nclass Types::PropertyType < Types::BaseObject\r\n  field :test_me, Boolean, null: false\r\n  def test_me\r\n    puts \"HEY\"\r\n    true\r\n  end\r\nend\r\n```\r\nand a test\r\n```ruby\r\nMySchema.types[\"Property\"].fields[\"testMe\"].resolve(property, {}, {})\r\n```\r\nno \"HEY\" is printed, and an error is thrown indicating that graphql-ruby used the default resolver implementation:\r\n\r\n```\r\nundefined method `test_me' for #<Property:0x00007f90c18a0800>\r\n   # /Users/matt/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activemodel-4.2.10/lib/active_model/attribute_methods.rb:433:in `method_missing'\r\n     # /Users/matt/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/graphql-ruby-d256dd26bc78/lib/graphql/schema/field.rb:305:in `public_send'\r\n     # /Users/matt/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/graphql-ruby-d256dd26bc78/lib/graphql/schema/field.rb:305:in `public_send_field'\r\n     # /Users/matt/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/graphql-ruby-d256dd26bc78/lib/graphql/schema/field.rb:235:in `resolve_field'\r\n     # /Users/matt/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/graphql-ruby-d256dd26bc78/lib/graphql/field.rb:247:in `call'\r\n     # /Users/matt/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/graphql-ruby-d256dd26bc78/lib/graphql/field.rb:247:in `resolve'\r\n```\r\n\r\nThis was tested with both pre10 and master. Actually pre10 gave a more cryptic error than master."},"comment":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/comments/400320126","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/1447#issuecomment-400320126","issue_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1447","id":400320126,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDMyMDEyNg==","user":{"login":"bessey","id":708200,"node_id":"MDQ6VXNlcjcwODIwMA==","avatar_url":"https://avatars2.githubusercontent.com/u/708200?v=4","gravatar_id":"","url":"https://api.github.com/users/bessey","html_url":"https://github.com/bessey","followers_url":"https://api.github.com/users/bessey/followers","following_url":"https://api.github.com/users/bessey/following{/other_user}","gists_url":"https://api.github.com/users/bessey/gists{/gist_id}","starred_url":"https://api.github.com/users/bessey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bessey/subscriptions","organizations_url":"https://api.github.com/users/bessey/orgs","repos_url":"https://api.github.com/users/bessey/repos","events_url":"https://api.github.com/users/bessey/events{/privacy}","received_events_url":"https://api.github.com/users/bessey/received_events","type":"User","site_admin":false},"created_at":"2018-06-26T14:02:18Z","updated_at":"2018-06-26T14:02:18Z","author_association":"NONE","body":"Any progress here? This is the one thing holding us back from the greatness that is 1.8!"}}
{"actor":{"display_login":"bessey"}}