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

feat(GraphQL): add support for between filter in GraphQL #6651

Merged
merged 19 commits into from
Oct 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
minor fix
minhaj-shakeel committed Oct 15, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 4da6cbcd223e59d04e1bd1441d4e8241f28b96c5
6 changes: 3 additions & 3 deletions graphql/resolve/query_rewriter.go
Original file line number Diff line number Diff line change
@@ -1079,7 +1079,7 @@ func buildFilter(typ schema.Type, filter map[string]interface{}) *gql.FilterTree
for _, v := range vals {
args = append(args, gql.Arg{Value: maybeQuoteArg(fn, v)})
}

case "near":
// For Geo type we have `near` filter which is written as follows:
// { near: { distance: 33.33, coordinate: { latitude: 11.11, longitude: 22.22 } } }
@@ -1097,8 +1097,8 @@ func buildFilter(typ schema.Type, filter map[string]interface{}) *gql.FilterTree
// between(numLikes,10,20). Order of arguments (min,max) is neccessary or
// it will return empty
vals := val.(map[string]interface{})
args = append(args, gql.Arg{Value: maybeQuoteArg(fn, vals["min"])}
gql.Arg{Value: maybeQuoteArg(fn, vals["max"])})
args = append(args, gql.Arg{Value: maybeQuoteArg(fn, vals["min"])},
gql.Arg{Value: maybeQuoteArg(fn, vals["max"])})

default:
args = append(args, gql.Arg{Value: maybeQuoteArg(fn, val)})