{"action":"opened","issue":{"url":"https://api.github.com/repos/john-kelly/elm-postgrest/issues/3","repository_url":"https://api.github.com/repos/john-kelly/elm-postgrest","labels_url":"https://api.github.com/repos/john-kelly/elm-postgrest/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/john-kelly/elm-postgrest/issues/3/comments","events_url":"https://api.github.com/repos/john-kelly/elm-postgrest/issues/3/events","html_url":"https://github.com/john-kelly/elm-postgrest/issues/3","id":183663578,"number":3,"title":"Non-trivial resource field codecs support","user":{"login":"danstn","id":708470,"avatar_url":"https://avatars.githubusercontent.com/u/708470?v=3","gravatar_id":"","url":"https://api.github.com/users/danstn","html_url":"https://github.com/danstn","followers_url":"https://api.github.com/users/danstn/followers","following_url":"https://api.github.com/users/danstn/following{/other_user}","gists_url":"https://api.github.com/users/danstn/gists{/gist_id}","starred_url":"https://api.github.com/users/danstn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danstn/subscriptions","organizations_url":"https://api.github.com/users/danstn/orgs","repos_url":"https://api.github.com/users/danstn/repos","events_url":"https://api.github.com/users/danstn/events{/privacy}","received_events_url":"https://api.github.com/users/danstn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-18T11:46:12Z","updated_at":"2016-10-18T11:46:12Z","closed_at":null,"body":"Is it currently possible to provide different codecs for decoding and encoding?\r\n\r\nThe use-case is as follows:\r\n\r\nResource `foo` has a field `email` that could be `null`, so we'd like our `Foo` model to represent `email` as `Maybe String`. The resource and query definition look like this:\r\n\r\n```elm\r\nfooResource = \r\n  resourse \"foo\"\r\n    { ...\r\n    , email = field \"email\" <| Decode.maybe Decode.string\r\n    , ...\r\n    }\r\n\r\nfooQuery = \r\n  query fooResource Foo\r\n    |> ...\r\n    |> select .email\r\n```\r\n\r\nThe problem is that if I try to apply a filter to the query (`|> filter [ .email |> in' [<list of strings>]`) the types don't line up, because the resource uses a `Maybe String` codec. \r\n\r\nIs there a way to say which codec to use when making requests?\r\n\r\nThere is a high chance that I'm missing something fundamental though.\r\n"}}
{"actor":{"display_login":"danstn"}}