{"action":"created","issue":{"url":"https://api.github.com/repos/graphql-java/graphql-java/issues/260","repository_url":"https://api.github.com/repos/graphql-java/graphql-java","labels_url":"https://api.github.com/repos/graphql-java/graphql-java/issues/260/labels{/name}","comments_url":"https://api.github.com/repos/graphql-java/graphql-java/issues/260/comments","events_url":"https://api.github.com/repos/graphql-java/graphql-java/issues/260/events","html_url":"https://github.com/graphql-java/graphql-java/issues/260","id":194521221,"number":260,"title":"graphql.schema.DataFetchingEnvironment can be an interface","user":{"login":"Jimexist","id":622789,"avatar_url":"https://avatars.githubusercontent.com/u/622789?v=3","gravatar_id":"","url":"https://api.github.com/users/Jimexist","html_url":"https://github.com/Jimexist","followers_url":"https://api.github.com/users/Jimexist/followers","following_url":"https://api.github.com/users/Jimexist/following{/other_user}","gists_url":"https://api.github.com/users/Jimexist/gists{/gist_id}","starred_url":"https://api.github.com/users/Jimexist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jimexist/subscriptions","organizations_url":"https://api.github.com/users/Jimexist/orgs","repos_url":"https://api.github.com/users/Jimexist/repos","events_url":"https://api.github.com/users/Jimexist/events{/privacy}","received_events_url":"https://api.github.com/users/Jimexist/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-09T06:09:04Z","updated_at":"2016-12-11T04:12:12Z","closed_at":null,"body":"So that it is easier for mocking.\r\n\r\nGlad to provide a PR if needed."},"comment":{"url":"https://api.github.com/repos/graphql-java/graphql-java/issues/comments/266259993","html_url":"https://github.com/graphql-java/graphql-java/issues/260#issuecomment-266259993","issue_url":"https://api.github.com/repos/graphql-java/graphql-java/issues/260","id":266259993,"user":{"login":"bbakerman","id":1661769,"avatar_url":"https://avatars.githubusercontent.com/u/1661769?v=3","gravatar_id":"","url":"https://api.github.com/users/bbakerman","html_url":"https://github.com/bbakerman","followers_url":"https://api.github.com/users/bbakerman/followers","following_url":"https://api.github.com/users/bbakerman/following{/other_user}","gists_url":"https://api.github.com/users/bbakerman/gists{/gist_id}","starred_url":"https://api.github.com/users/bbakerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbakerman/subscriptions","organizations_url":"https://api.github.com/users/bbakerman/orgs","repos_url":"https://api.github.com/users/bbakerman/repos","events_url":"https://api.github.com/users/bbakerman/events{/privacy}","received_events_url":"https://api.github.com/users/bbakerman/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T04:12:12Z","updated_at":"2016-12-11T04:12:12Z","body":"Can I make another suggestion... it should generic as well.\r\n\r\n        public DataFetcher exampleFetcher() {\r\n        return environment -> {\r\n            GraphContext context = (GraphContext) environment.getContext();\r\n            return supplierMethodCall(context);\r\n        };\r\n    }\r\n\r\nWith no generics we have the above.  The ACTUAL return type is Object so its hard to maintain.  But the shape of fetched objects are really important.\r\n\r\nWhere as\r\n\r\n    public DataFetcher<FooObject> exampleFetcher() {\r\n        return environment -> {\r\n            GraphContext context = (GraphContext) environment.getContext();\r\n            return supplierMethodCall(context);\r\n        };\r\n    }\r\n\r\nTells a maintainer what they need to know.  It must return a FooObject and hence so must the method call etc..\r\n\r\nIn fact this could be applied to a number of places in GraphQL Java.  I think I may raise another issue to cover this specifically rather than hijack this isssue"}}
{"actor":{"display_login":"bbakerman"}}