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

fix(GraphQL): fix exclusion of filters in Query generation in case of… #6917

Merged
merged 2 commits into from
Nov 20, 2020

Conversation

minhaj-shakeel
Copy link
Contributor

@minhaj-shakeel minhaj-shakeel commented Nov 19, 2020

… just Has Filters. (#6870)

Fixes GRAPHQL-787.

This PR fixes the Bug in query and mutations generation in case of types that have just has filter and not any other kind of filter. For example for the given type:

type Student {
   name: String
   age: Int
}

the corresponding query generated was

queryStudent(order: StudentOrder, first: Int, offset: Int): [Student]

and only add mutation was being generated.
Whereas, the correct query should be:

queryStudent(filter: StudentFilter, order: StudentOrder, first: Int, offset: Int): [Student]

and corresponding update and delete mutation should be:

updateStudent(input: UpdateStudentInput!): UpdateStudentPayload
deleteStudent(filter: StudentFilter!): DeleteStudentPayload

(cherry picked from commit 5e60ef1)


This change is Reviewable

… just Has Filters. (#6870)

Fixes GRAPHQL-787.

This PR fixes the Bug in query and mutations generation in case of types that have just `has` filter and not any other kind of filter. For example for the given type:
```
type Student {
   name: String
   age: Int
}
```
the corresponding query generated was
```
queryStudent(order: StudentOrder, first: Int, offset: Int): [Student]
```
and only `add` mutation was being generated.
Whereas, the correct query should be:
```
queryStudent(filter: StudentFilter, order: StudentOrder, first: Int, offset: Int): [Student]
```
and corresponding update and delete mutation should be:
```
updateStudent(input: UpdateStudentInput!): UpdateStudentPayload
deleteStudent(filter: StudentFilter!): DeleteStudentPayload
```

(cherry picked from commit 5e60ef1)
@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Nov 19, 2020
Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of tests seem to be failing

@minhaj-shakeel minhaj-shakeel merged commit 97b3d57 into release/v20.11 Nov 20, 2020
@minhaj-shakeel minhaj-shakeel deleted the minhaj/cherry-pick-6 branch November 20, 2020 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

2 participants