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): Make XID node referencing invariant of order in which XIDs are referenced in Mutation Rewriting #7448

Merged
merged 3 commits into from
Feb 18, 2021

Conversation

vmrajas
Copy link
Contributor

@vmrajas vmrajas commented Feb 18, 2021

Currently, in rewriteObject function, the fields inside given Add / Update Mutations are sorted before iterating on them and recursively calling rewriteObject function. This behaviour ensures that the fields are considered in the same order in rewriteObject and existenceQueries function.

The drawback this as is follows,

  1. If a there is a node which is created and referenced in the same mutation, depending on the order in which the nodes (creation and reference) get visited, an error may be thrown.

This issue has been present even before the refactoring. This PR fixes this.

Testing:
Added unit test in .yaml


This change is Reviewable

@vmrajas vmrajas requested a review from pawanrawal February 18, 2021 05:40
@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Feb 18, 2021
@vmrajas vmrajas changed the title Feat(GraphQL): Make XID node referencing invariant of order in which XIDs are referenced Feat(GraphQL): Make XID node referencing invariant of order in which XIDs are referenced in Mutation Rewriting Feb 18, 2021
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.

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @vmrajas)

@vmrajas vmrajas merged commit 4fb4ff2 into master Feb 18, 2021
@vmrajas vmrajas deleted the GRAPHQL-1023 branch February 18, 2021 11:10
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