Khan/genqlient

Support `optional: generic` inline

Open

#320 建立於 2024年2月19日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Go (141 fork)github user discovery
enhancementhelp wanted

倉庫指標

Star
 (1,310 star)
PR 合併指標
 (PR 指標待抓取)

描述

Is your feature request related to a problem? Please describe. We now have support for mapping GraphQL optional types to generics (see #251). In many schemas, though, you don't want to deal with that everywhere; for example for some fields mapping to empty-string is clear enough and easier to use. We should allow flagging the generic for just certain fields.

Describe the solution you'd like Probably the way to do this is to still put optional_generic_type in the genqlient.yaml, but omit optional: generic and then do that inline. We could also let you specify both inline, but I really hope you don't need that and requiring it would be very verbose.

Describe alternatives you've considered As anyone who has used genqlient knows, I hate using pointers for optionality! But sometimes zero values don't cut it.

貢獻者指南