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 has filter support #6258

Merged
merged 6 commits into from
Aug 24, 2020

Conversation

minhaj-shakeel
Copy link
Contributor

@minhaj-shakeel minhaj-shakeel commented Aug 21, 2020

Fixes GRAPHQL-285

This PR extends GraphQL by adding the capability to query using has filter. has was previously available in DQL (GraphQL+-), and from now on will also be part of GraphQL.

has filters out results for a field which have null value.
For eg: for the given type:

type Student {
   tid: ID!
   age: Int!
   name: String

}

The given query:

queryStudent(filter: { has : name } ){
   ...
}

filters return us only those students who have some nonNull value for the field name.


This change is Reviewable

Docs Preview: Dgraph Preview

* add HadFilter In the Schema

* fix deepsource failure

* fix Teamcity failure

* fix TestCases

* address Pawan's comments

* address Pawan's Comments
* add has filter in query_rewriter and add test case

* remove space

* change Predicate Format and add test cases

* minor changes

* remove spaces

* change in testcases

* address Pawan's comments

* add more test cases

* fix CI failure

* add more test cases
* add test data

* add e2e tests

* remove spacing

* change format of has query

* change addPost mutation
@minhaj-shakeel minhaj-shakeel merged commit c8b73e3 into master Aug 24, 2020
@minhaj-shakeel minhaj-shakeel deleted the minhaj/addHasFilterToGraphQL branch August 24, 2020 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants