-
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 between filter in GraphQL #6651
Conversation
Currently |
…haj/between-filter
…haj/between-filter
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.
It's looking great but some CI tests are failing. Can you fix those?
Reviewed 49 of 49 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @MichaelJCompton and @minhaj-shakeel)
graphql/e2e/common/query.go, line 449 at r2 (raw file):
err := json.Unmarshal([]byte(gqlResponse.Data), &result) require.NoError(t, err) require.Equal(t, 3, len(result.QueryPost))
Can we compare the result as well?
graphql/resolve/query_rewriter.go, line 1097 at r2 (raw file):
// between(numLikes,10,20). Order of arguments (min,max) is neccessary or // it will return empty vals := val.(map[string]interface{})
Is this safe to do? We should check the second argument and return an error if this conversion is not possible.
graphql/resolve/query_rewriter.go, line 1098 at r2 (raw file):
// it will return empty vals := val.(map[string]interface{}) args = append(args, gql.Arg{Value: maybeQuoteArg(fn, vals["min"])})
You can do this in one statement.
args = append(args, arg1 , arg2)
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.
Reviewable status: 46 of 49 files reviewed, 3 unresolved discussions (waiting on @MichaelJCompton and @pawanrawal)
graphql/e2e/common/query.go, line 449 at r2 (raw file):
Previously, pawanrawal (Pawan Rawal) wrote…
Can we compare the result as well?
Done.
graphql/resolve/query_rewriter.go, line 1097 at r2 (raw file):
Previously, pawanrawal (Pawan Rawal) wrote…
Is this safe to do? We should check the second argument and return an error if this conversion is not possible.
Yeah, it is safe as it will be get caught up in the validation stage.
graphql/resolve/query_rewriter.go, line 1098 at r2 (raw file):
Previously, pawanrawal (Pawan Rawal) wrote…
You can do this in one statement.
args = append(args, arg1 , arg2)
Done.
Fixes GRAPHQL-667.
This PR extend support for
between
filter in GraphQL. This filter can be used for all scalars when indexed in a type (exact
index forString
). For the given typebetween filter
can be used both on theage
andname
field. for eg:and
are both valid queries.
This change is
Docs Preview: