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 query rewriting for multiple order on nested field (#7523) #7536

Merged
merged 3 commits into from
Mar 10, 2021

Conversation

JatinDev543
Copy link
Contributor

@JatinDev543 JatinDev543 commented Mar 9, 2021

We were not adding the , in-between multiple orders in query rewriting for the nested field.
For example the order given in this filter

posts(filter: { title: { anyofterms: "GraphQL" } }, order: { asc: numLikes, then: { desc: title } }, first: 10, offset: 10) got written to below dgraph statement

Author.posts : Author.posts @filter(anyofterms(Post.title, "GraphQL")) (orderasc: Post.numLikesorderdesc: Post.title, first: 10, offset: 10)

where there is no comma between two orders. We have fixed it in this PR.

(cherry picked from commit 8e835f1)


This change is Reviewable

…#7523)

We were not adding the , in-between multiple orders in query rewriting for the nested field.
For example the order given in this filter

posts(filter: { title: { anyofterms: "GraphQL" } }, order: { asc: numLikes, then: { desc: title } }, first: 10, offset: 10) got written to below dgraph statement

Author.posts : Author.posts @filter(anyofterms(Post.title, "GraphQL")) (orderasc: Post.numLikesorderdesc: Post.title, first: 10, offset: 10)

where there is no comma between two orders. We have fixed it in this PR.

(cherry picked from commit 8e835f1)
@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Mar 9, 2021
@JatinDev543 JatinDev543 merged commit 856fad4 into release/v20.11 Mar 10, 2021
@joshua-goldstein joshua-goldstein deleted the jatin/cherryPick-GRAPHQL-1065 branch August 11, 2022 21:05
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