It could be useful to annotate optional fields annotate with omitempty when using pointers.
By allowing this option, input fields that get removed (and not used is the executed queries) will not break.
This gives the library an advantage to be more resilient against break API changes.
To introduce this option, a new optional config value is introduced pointer_omitempty.
If optional: pointer_omitempty is set. We generate
type Task_insert_input struct {
Id: *int `json:"id,omitempty"`
}
based on
input task_insert_input {
id: Int
}
The @genqlient(omitempty) config will override the previous defined config.
I have:
[x] Written a clear PR title and description (above)
It could be useful to annotate optional fields annotate with
omitempty
when using pointers. By allowing this option, input fields that get removed (and not used is the executed queries) will not break. This gives the library an advantage to be more resilient against break API changes.To introduce this option, a new
optional
config value is introducedpointer_omitempty
.If
optional: pointer_omitempty
is set. We generatebased on
The
@genqlient(omitempty)
config will override the previous defined config.I have: