-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(GraphQL): add support for IN filter #6662
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 3 rules errored during the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 6 rules errored during the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 1 rules errored during the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issues found. 8 rules errored during the review.
// in takes List of Scalars as argument, for eg: | ||
// code : { in: {"abc", "def", "ghi"} } -> eq(State.code,"abc","def","ghi") | ||
case "in": | ||
vals := val.([]interface{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unchecked type assertions can cause panics. Check for success with the x, ok := y.(type) style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 8 rules errored during the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 44 of 44 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @codelingo[bot], @MichaelJCompton, and @minhaj-shakeel)
graphql/e2e/common/query.go, line 350 at r1 (raw file):
func InFilter(t *testing.T) { addStateParams := &GraphQLParams{
inFilter
graphql/e2e/common/query.go, line 368 at r1 (raw file):
} gqlResponse := addStateParams.ExecuteAsPost(t, GraphqlURL)
Can we also add a test where in
used for updateState
.
graphql/resolve/query_rewriter.go, line 1068 at r1 (raw file):
Previously, codelingo[bot] wrote…
Unchecked type assertions can cause panics. Check for success with the x, ok := y.(type) style.
Add a comment saying that
No need to check for type as this would not pass the GraphQL validation if vals was not a list.
graphql/resolve/query_test.yaml, line 5 at r1 (raw file):
gqlquery: | query { queryState(filter: {code: {in: ["abc", "def", "ghi"]}}) {
Add a case with both in
and eq
in an AND/OR condition
Fixes GRAPHQL-712.
This PR adds support for the
IN
filter in GraphQL.For the given type State having @id directive at the field code :
Suppose we want to query States having either code =
abc
ordef
, then the corresponding GraphQL query is:This change is
Docs Preview: