-
Notifications
You must be signed in to change notification settings - Fork 114
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
fix: premarshal structs get generated with omitempty tag #267
Conversation
Thanks! I'll take a closer look later but a few quick comments now:
|
Here's what I'm thinking for that: Click me##################
# Hasura.graphql #
##################
query GetPokemon($where: getPokemonBoolExp!) {
getPokemon(where: $where) {
level
}
}
##################
# schema.graphql #
##################
type Query {
getPokemon(where: getPokemonBoolExp): [Pokemon!]!
}
input getPokemonBoolExp {
_and: [getPokemonBoolExp!]
_not: getPokemonBoolExp
_or: [getPokemonBoolExp!]
level: IntComparisonExp
}
input IntComparisonExp {
_eq: Int
_gt: Int
_gte: Int
_in: [Int!]
_isNull: Boolean
_lt: Int
_lte: Int
_neq: Int
_nin: [Int!]
} |
OK, I managed to get snapshot generation working with
The challenge I'm now facing — and maybe this is not relevant to the original ticket — is to get omitempty tags on the fields inside |
Great, thanks! I think |
This PR addresses a bug described in #263
Basically, whenever a struct involves a custom genqlient binding, a secondary "premarshal" struct gets generated.
The bug was that this "premarshal" struct was not propagating the
omitempty
JSON tags, which was resulting in unexpected behavior.The fix involved a few changed lines in the Go template, and a few changes in the unit tests.
I have: