{"action":"created","issue":{"url":"https://api.github.com/repos/davidpdrsn/juniper-eager-loading/issues/7","repository_url":"https://api.github.com/repos/davidpdrsn/juniper-eager-loading","labels_url":"https://api.github.com/repos/davidpdrsn/juniper-eager-loading/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/davidpdrsn/juniper-eager-loading/issues/7/comments","events_url":"https://api.github.com/repos/davidpdrsn/juniper-eager-loading/issues/7/events","html_url":"https://github.com/davidpdrsn/juniper-eager-loading/issues/7","id":455105149,"node_id":"MDU6SXNzdWU0NTUxMDUxNDk=","number":7,"title":"Support HasMany with Option/nullable foreign key ","user":{"login":"kiljacken","id":209321,"node_id":"MDQ6VXNlcjIwOTMyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/209321?v=4","gravatar_id":"","url":"https://api.github.com/users/kiljacken","html_url":"https://github.com/kiljacken","followers_url":"https://api.github.com/users/kiljacken/followers","following_url":"https://api.github.com/users/kiljacken/following{/other_user}","gists_url":"https://api.github.com/users/kiljacken/gists{/gist_id}","starred_url":"https://api.github.com/users/kiljacken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiljacken/subscriptions","organizations_url":"https://api.github.com/users/kiljacken/orgs","repos_url":"https://api.github.com/users/kiljacken/repos","events_url":"https://api.github.com/users/kiljacken/events{/privacy}","received_events_url":"https://api.github.com/users/kiljacken/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-06-12T09:26:55Z","updated_at":"2019-06-12T09:58:52Z","closed_at":null,"author_association":"NONE","body":"I have a schema that looks something like the following:\r\n```\r\nschema { .. }\r\ntype Query { .. }\r\ntype Mutation { .. }\r\ntype ArtistUser {\r\n    id: ID! @juniper(ownership: \"owned\")\r\n    name: String!\r\n}\r\n\r\ntype Album {\r\n    id: ID! @juniper(ownership: \"owned\")\r\n    name: String!\r\n    artist: ArtistUser!\r\n    tracks: [Track!]!\r\n}\r\n\r\ntype Track {\r\n    id: ID! @juniper(ownership: \"owned\")\r\n    name: String!\r\n    artist: ArtistUser!\r\n    album: Album,\r\n}\r\n```\r\n\r\nHaving derived eager loading for all the graphql types, and LoadFrom for the models, I get an error attempting to compare `i64 == Option<i64>` because the foreign key field on a track is optional.\r\n\r\nLooking at the codegen for is_child shows [where the issue occurs](https://github.com/davidpdrsn/juniper-eager-loading/blob/master/juniper-eager-loading-code-gen/src/derive_eager_loading.rs#L413). I'd love to provide the needed functionality in a PR, but could use some input on how you'd want it implemented.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/davidpdrsn/juniper-eager-loading/issues/comments/501204907","html_url":"https://github.com/davidpdrsn/juniper-eager-loading/issues/7#issuecomment-501204907","issue_url":"https://api.github.com/repos/davidpdrsn/juniper-eager-loading/issues/7","id":501204907,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMTIwNDkwNw==","user":{"login":"davidpdrsn","id":718941,"node_id":"MDQ6VXNlcjcxODk0MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/718941?v=4","gravatar_id":"","url":"https://api.github.com/users/davidpdrsn","html_url":"https://github.com/davidpdrsn","followers_url":"https://api.github.com/users/davidpdrsn/followers","following_url":"https://api.github.com/users/davidpdrsn/following{/other_user}","gists_url":"https://api.github.com/users/davidpdrsn/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpdrsn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpdrsn/subscriptions","organizations_url":"https://api.github.com/users/davidpdrsn/orgs","repos_url":"https://api.github.com/users/davidpdrsn/repos","events_url":"https://api.github.com/users/davidpdrsn/events{/privacy}","received_events_url":"https://api.github.com/users/davidpdrsn/received_events","type":"User","site_admin":false},"created_at":"2019-06-12T09:58:52Z","updated_at":"2019-06-12T09:58:52Z","author_association":"OWNER","body":"Great!\r\n\r\nI've thought about this as well. I think using `HasMany` is fine since the default is an empty vec already. I guess that also makes sense in this case."}}
{"actor":{"display_login":"davidpdrsn"}}