I have a huge schema of 235k predicates and my application has to retrieve that schema from dgraph first. I am using
schema { predicate type }
Which becomes a 17 MB gRPC response message, so I get the following exception:
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 17476444
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
at io.dgraph.DgraphAsyncClient.lambda$runWithRetries$2(DgraphAsyncClient.java:181)
... 6 more
I can set the max inbound message size via maxInboundMessageSize to a higher value, e.g.
but no matter what value limit I set, there might be a schema that breaks this setting. I’d rather like a solution that 1) works for any schema and 2) has a small limited memory footprint. Is there something like pagination available for the schema { … } query, like first, offset and after?
We don’t support pagination on the schema query right now but we could support it. Could you please open an issue on GitHub and we can look into supporting it?
A related issue is when I query the schema like schema { predicate type } I get predicates and types, and there is no way to get types or predicates only:
There is a lot redundant or for me irrelevant information in that response, so I would like to be able to query more specifically and retrieve only "types" or "schema".