Add request and response cases for `Optional` values
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 144
- Avg merge
- 4h 50m
- Merged PRs (30d)
- 1
Description
**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:
```yaml
optional:
request: pointer
response: value # use value as default if empty
```
Alternative
```yaml
request:
optional: pointer
use_struct_references: true
response:
optional: value
use_struct_references: false
```
Contributor guide
Research direction
Start with the genqlient.yaml configuration described in the issue and trace how optional fields are represented in generated request and response types. The work is done when separate request and response options support pointer input and value output, with tests covering both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, graphql
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100