(ctx context.Context, txn *dgo.Txn, userId string, groupId string)
| 537 | } |
| 538 | |
| 539 | func getUserModNQuad(ctx context.Context, txn *dgo.Txn, userId string, |
| 540 | groupId string) (*api.NQuad, error) { |
| 541 | group, err := queryGroup(ctx, txn, groupId) |
| 542 | if err != nil { |
| 543 | return nil, err |
| 544 | } |
| 545 | if group == nil { |
| 546 | return nil, fmt.Errorf("group %q does not exist", groupId) |
| 547 | } |
| 548 | |
| 549 | createUserGroupNQuads := &api.NQuad{ |
| 550 | Subject: userId, |
| 551 | Predicate: "dgraph.user.group", |
| 552 | ObjectId: group.Uid, |
| 553 | } |
| 554 | |
| 555 | return createUserGroupNQuads, nil |
| 556 | } |
| 557 | |
| 558 | func queryGroup(ctx context.Context, txn *dgo.Txn, groupid string, |
| 559 | fields ...string) (group *Group, err error) { |
no test coverage detected
searching dependent graphs…