Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support optional: generic inline #320

Open
benjaminjkraft opened this issue Feb 19, 2024 · 0 comments
Open

Support optional: generic inline #320

benjaminjkraft opened this issue Feb 19, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Issues that anyone could pick up and implement if useful to them

Comments

@benjaminjkraft
Copy link
Collaborator

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.

@benjaminjkraft benjaminjkraft added enhancement New feature or request help wanted Issues that anyone could pick up and implement if useful to them labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Issues that anyone could pick up and implement if useful to them
Projects
None yet
Development

No branches or pull requests

1 participant