Report a Dgraph Client Bug
What Dgraph client (and version) are you using?
(put “x” in the box to select)
- PyDgraph
Version:
21.3.2
What version of Dgraph are you using?
v21.12
Have you tried reproducing the issue with the latest release?
No
Steps to reproduce the issue (command/config used to run Dgraph).
txn = dql_client.txn()
mutation = txn.create_mutation(
set_obj={ 'value': 'this is a test' },
)
request = txn.create_request(
query=r'{ TEST as var(func: eq(slug, $slug)) }',
mutations=[mutation],
variables={ '$slug': 'a-slug' },
commit_now=True
)
res = txn.do_request(request)
Expected behaviour and actual result.
I was hoping to be able to use mutation with query+variables.
This is the error I’m getting:
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Variable not defined $slug"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2023-08-31T18:58:44.532179682+00:00", grpc_status:2, grpc_message:"Variable not defined $slug"}"