{"action":"created","issue":{"url":"https://api.github.com/repos/kiwicom/graphql/issues/81","repository_url":"https://api.github.com/repos/kiwicom/graphql","labels_url":"https://api.github.com/repos/kiwicom/graphql/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/kiwicom/graphql/issues/81/comments","events_url":"https://api.github.com/repos/kiwicom/graphql/issues/81/events","html_url":"https://github.com/kiwicom/graphql/issues/81","id":316577458,"number":81,"title":"Make \"findOne\" queries to return non-nulls","user":{"login":"jaroslav-kubicek","id":2174629,"avatar_url":"https://avatars3.githubusercontent.com/u/2174629?v=4","gravatar_id":"","url":"https://api.github.com/users/jaroslav-kubicek","html_url":"https://github.com/jaroslav-kubicek","followers_url":"https://api.github.com/users/jaroslav-kubicek/followers","following_url":"https://api.github.com/users/jaroslav-kubicek/following{/other_user}","gists_url":"https://api.github.com/users/jaroslav-kubicek/gists{/gist_id}","starred_url":"https://api.github.com/users/jaroslav-kubicek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaroslav-kubicek/subscriptions","organizations_url":"https://api.github.com/users/jaroslav-kubicek/orgs","repos_url":"https://api.github.com/users/jaroslav-kubicek/repos","events_url":"https://api.github.com/users/jaroslav-kubicek/events{/privacy}","received_events_url":"https://api.github.com/users/jaroslav-kubicek/received_events","type":"User","site_admin":false},"labels":[{"id":910083259,"url":"https://api.github.com/repos/kiwicom/graphql/labels/proposal","name":"proposal","color":"7fef84","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-22T13:03:39Z","updated_at":"2018-04-22T13:10:58Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"We have several queries that have one in common: they accept one param, usually `ID` and return single entity - `Booking`, `FAQArticle` etc. Also, dataloaders are usually defined in a way that they correctly throw an Error if nothing is found.\r\n\r\nYet they are defined as nullable, e.g. booking query\r\n\r\n```\r\nexport default {\r\n  type: GraphQLBooking, // may be null (doesn't exist)\r\n}\r\n```\r\n\r\n... which doesn't make sense in combination with dataloader behaviour.\r\n\r\nAdditionally, add info about this expected characteristic into CONTRIBUTION guide - that \"findOne\" queries should always throw an error on 404, return non-null entity and probably accept opaque ID from related \"findMany\" query if there is such query\r\n"},"comment":{"url":"https://api.github.com/repos/kiwicom/graphql/issues/comments/383380565","html_url":"https://github.com/kiwicom/graphql/issues/81#issuecomment-383380565","issue_url":"https://api.github.com/repos/kiwicom/graphql/issues/81","id":383380565,"user":{"login":"jaroslav-kubicek","id":2174629,"avatar_url":"https://avatars3.githubusercontent.com/u/2174629?v=4","gravatar_id":"","url":"https://api.github.com/users/jaroslav-kubicek","html_url":"https://github.com/jaroslav-kubicek","followers_url":"https://api.github.com/users/jaroslav-kubicek/followers","following_url":"https://api.github.com/users/jaroslav-kubicek/following{/other_user}","gists_url":"https://api.github.com/users/jaroslav-kubicek/gists{/gist_id}","starred_url":"https://api.github.com/users/jaroslav-kubicek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaroslav-kubicek/subscriptions","organizations_url":"https://api.github.com/users/jaroslav-kubicek/orgs","repos_url":"https://api.github.com/users/jaroslav-kubicek/repos","events_url":"https://api.github.com/users/jaroslav-kubicek/events{/privacy}","received_events_url":"https://api.github.com/users/jaroslav-kubicek/received_events","type":"User","site_admin":false},"created_at":"2018-04-22T13:10:58Z","updated_at":"2018-04-22T13:10:58Z","author_association":"CONTRIBUTOR","body":"I mean - if such queries are expected to always return something or fail otherwise, then it makes sense to create them non-nullable by definition, not just by the inner implementation."}}
{"actor":{"display_login":"jaroslav-kubicek"}}