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

graphql: Fix deleteGroup and deleteUser mutations. #4820

Merged
merged 7 commits into from
Feb 20, 2020

Conversation

pawanrawal
Copy link
Contributor

@pawanrawal pawanrawal commented Feb 20, 2020

deleteGroup should also delete the group from the user group lists that it belongs to. This was not happening before because we were not adding the delete mutation like we do for fields which have the @hasInverse directive. This happens now.

deleteUser should also delete the user from the groups that it belongs to. This was not happening because Dgraph didn't have the type info for User type and wasn't correctly deleting its edges. Now the type information is added to the list of initial types.


This change is Reviewable

Docs Preview: Dgraph Preview

@pawanrawal pawanrawal marked this pull request as ready for review February 20, 2020 11:10
@pawanrawal pawanrawal requested review from manishrjain and a team as code owners February 20, 2020 11:10

InitialTypes = `
"types": [{"fields": [{"name": "dgraph.graphql.schema"}],"name": "dgraph.graphql"},
{"fields": [{"name": "dgraph.password"},{"name": "dgraph.xid"},{"name": "dgraph.user.group"}],"name": "User"},

Choose a reason for hiding this comment

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

line is 110 characters (from lll)

@pawanrawal pawanrawal added the area/graphql Issues related to GraphQL support on Dgraph. label Feb 20, 2020
Copy link
Contributor

@harshil-goel harshil-goel left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 13 files reviewed, 1 unresolved discussion (waiting on @harshil-goel, @manishrjain, @MichaelJCompton, and @pawanrawal)

@pawanrawal pawanrawal merged commit 5ed4e38 into master Feb 20, 2020
@pawanrawal pawanrawal deleted the pawanrawal/graphql-acl-delete-group branch February 20, 2020 16:08
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.

3 participants