Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(GraphQL): fix internal Aliases name generation (#7009)
This PR modifies how the internal graph aliases are generated in case of multiple aliases of same field in the query. For the given graphql query: ``` query { queryAuthor { name p1: posts(filter: {isPublished: true}){ title text } p2: posts(filter: {isPublished: true}){ title text } } } ``` earlier it was rewritten into: ``` query { queryAuthor(func: type(Author)) { name : Author.name posts : Author.posts @filter(eq(Post.isPublished, true)) { title : Post.title text : Post.text dgraph.uid : uid } posts1 : Author.posts @filter(eq(Post.isPublished, true)) { title : Post.title text : Post.text dgraph.uid : uid } dgraph.uid : uid } } ``` Now it is changed to: ``` query { queryAuthor(func: type(Author)) { name : Author.name posts : Author.posts @filter(eq(Post.isPublished, true)) { title : Post.title text : Post.text dgraph.uid : uid } posts.1 : Author.posts @filter(eq(Post.isPublished, true)) { title : Post.title text : Post.text dgraph.uid : uid } dgraph.uid : uid } } ``` (cherry picked from commit 953f656)
- Loading branch information