I Want to Do
I would like to use the dgraph-js-http within my angular application to communicate with a self-hosted Dgraph cluster. Also I would like to use this client with dql and not just graphql as I need ability to do groupby and facets.
What I Did
I have a standalone Dgraph instance running locally and also a angular application setup. Unfortunately the dgraph-js-http client has a dependency on jsonwebtokens which in turn depends upon a few libraries like crypto, stream, buffer etc that are not available in a browser context. Angular from version 6 has stopped allowing the use of such libraries within its context, please see below:
I modified my tsconfig and polyfills for global/buffer but kept on getting the issue with other libraries that are node specific being depended upon by dgraph-js-http (jsonwebtokens). The Dgraph documentation clearly states this client supports browser environments but it relies heavily on libraries that are specific to node environments.
Is there any workaround for this or any fix planned?