Python primer test on dgraph

Ok so i got the dgraph setup in an AWS test instance and ratel working fine connecting to it.
I wrote a simple python script and referred to the easiest example i can find :slight_smile:

from pydgraph.client import DgraphClient

g_Host = “”

def AddData () :

dg_client = DgraphClient(g_Host, 8080)

response = dg_client.query("""mutation
            <alice> <name> \"Alice\" .
            <greg> <name> \"Greg\" .
            <alice> <follows> <greg> .

        me(_xid_: alice)
                name _xid_


if name == “main” :

—> But it gave an error and i do not know how to proceed from here

grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.UNAVAILABLE, details="")

This example would not work as query and mutation need to be separate operations.

There is a pending PR for pydgraph at which should be merged soon by @gpahal. The PR would also add examples.

The example are taken from :

Update on docs would be useful for new comers.

Sure, once the PR is merged we will update the docs here as well.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.