Skip to content
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

func BooleanFilterToMods has empty body #22

Closed
troian opened this issue May 11, 2020 · 6 comments
Closed

func BooleanFilterToMods has empty body #22

troian opened this issue May 11, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@troian
Copy link

troian commented May 11, 2020

func BooleanFilterToMods(m *graphql_models.BooleanFilter, column string) []qm.QueryMod {

	return nil
}
@RichardLindhout
Copy link
Member

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

@RichardLindhout
Copy link
Member

RichardLindhout commented May 11, 2020

This should probably work not really sure if this is ideal though. It should probably just be a boolean with support for this: #17 (comment)

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
}

@troian
Copy link
Author

troian commented May 11, 2020

The Sample you've provided exactly same what we've ended up with)

@RichardLindhout
Copy link
Member

Are you in favor of changing input in scheme to:

input BooleanFilter {
  equalTo: Boolean
  notEqualTo: Boolean
}

@troian
Copy link
Author

troian commented May 11, 2020

Yah, sounds good

RichardLindhout added a commit to web-ridge/sqlboiler-graphql-schema that referenced this issue May 11, 2020
@RichardLindhout
Copy link
Member

Fixed in v2.0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants