How to increase message size in gprc for fetching all nodes of dgraph?

Moved from GitHub pydgraph/48

Posted by AmoghM:

when I try to fetch all nodes and its attributes from dgraph using the query:
query = """ { total (func: has (_predicate_) ) { count(uid) uid } }"""
I get error:

grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.RESOURCE_EXHAUSTED
details = “Received message larger than max (4673233 vs. 4194304)”
debug_error_string = “{“created”:”@1550746922.282325865",“description”:“Received message larger than max (4673233 vs.4194304)”,“file”:“src/core/ext/filters/message_size/”,“file_line”:174,“grpc_status”:8}"

I try to use the code below to increase the size but it doesn’t work.
channel = grpc.insecure_channel('', options=[('grpc.max_send_message_length', MAX_MESSAGE_LENGTH), ( 'grpc.max_receive_message_length', MAX_MESSAGE_LENGTH)])
Source: Stack Overflow

How can I increase the size? Or is there a better way to iterate over all the nodes of dgraph?

AmoghM commented :

Sorry Folks, found the solution.

orange-oranje commented :

What is the solution though ?