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

Add request and response cases for Optional values #242

Open
Jictyvoo opened this issue Dec 2, 2022 · 1 comment
Open

Add request and response cases for Optional values #242

Jictyvoo opened this issue Dec 2, 2022 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@Jictyvoo
Copy link

Jictyvoo commented Dec 2, 2022

Is your feature request related to a problem? Please describe.
Currently I'm using the Go default values for a response in a lot of fields. But currently I need to to send a pointer for optional values, and still receive the value as the response.

Describe the solution you'd like
On the file genqlient.yaml have a new config that receives the option that will be used on optional on request, and another option on response.

Describe alternatives you've considered
On the genqlient.yaml have the following alternatives:

optional:
    request: pointer
    response: value # use value as default if empty

Alternative

request:
    optional: pointer
    use_struct_references: true
response:
    optional: value
    use_struct_references: false
@Jictyvoo Jictyvoo added the enhancement New feature or request label Dec 2, 2022
@benjaminjkraft
Copy link
Collaborator

Seems reasonable to me! As far as I can guess it should be easy enough to implement. (Although I won't likely have time soon, so PRs extra welcome!) I like the first config option.

@benjaminjkraft benjaminjkraft added this to the v1.0 milestone Jan 26, 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
Projects
None yet
Development

No branches or pull requests

2 participants