Closed troian closed 4 years ago
That's right can you make a PR for that? I did not have boolean usecase yet so not fully sure how to make working queries for it
This should probably work not really sure if this is ideal though. It should probably just be a boolean with support for this: https://github.com/web-ridge/gqlgen-sqlboiler/issues/17#issuecomment-626584956
Maybe we should have it more like string filtering or instead of BooleanFIlter just a boolean
func BooleanFilterToMods(m *graphql_models.BooleanFilter, column string) []qm.QueryMod {
if m == nil {
return nil
}
var queryMods []qm.QueryMod
if m.IsFalse != nil {
queryMods = append(queryMods, qmhelper.Where(column, qmhelper.EQ, false))
}
if m.IsTrue != nil {
queryMods = append(queryMods, qmhelper.Where(column, qmhelper.EQ, true))
}
if m.IsNull != nil {
queryMods = append(queryMods, qmhelper.Where(column, qmhelper.EQ, nil))
}
return queryMods
}
The Sample you've provided exactly same what we've ended up with)
Are you in favor of changing input in scheme to:
input BooleanFilter {
equalTo: Boolean
notEqualTo: Boolean
}
Yah, sounds good
Fixed in v2.0.12