Skip to content

Commit 4a519e5

Browse files
authored
Expose an API for returning the apiv2 dgraph client (#264)
1 parent b37dc38 commit 4a519e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clientv2.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ func (d *Dgraph) Close() {
256256
}
257257
}
258258

259+
// GetAPIv2Client returns the apiv2 DgraphClient that is useful for advanced
260+
// cases when grpc API that are not exposed in dgo needs to be used.
261+
func (d *Dgraph) GetAPIv2Client() []apiv2.DgraphClient {
262+
return d.dcv2
263+
}
264+
259265
// signInUser logs the user in using the provided username and password.
260266
func (d *Dgraph) signInUser(ctx context.Context, username, password string) error {
261267
if d.useV1 {

0 commit comments

Comments
 (0)