When optional: "pointer" is configured, omitempty is needed for input fields for the generated code to be semantically correct. Without omitempty an empty pointer would generate an "empty value" which is incorrect.
Consider the following graphql schema generated by Hasura:
input task_insert_input {
id: Int
}
Without this fix, the following golang struct will be generated:
type Task_insert_input struct {
Id: *int `json:"id"`
}
When optional: "pointer" is configured, omitempty is needed for input fields for the generated code to be semantically correct. Without omitempty an empty pointer would generate an "empty value" which is incorrect.
Consider the following graphql schema generated by Hasura:
Without this fix, the following golang struct will be generated:
I have: