How to execute dgraph API in react-native app

can someone please guide through or provide an example of how can I consume dgraph API in a react native app.

It is not recommended to give direct access to Dgraph to the applications you have (unless you have ACL or some testing concepts). It is recommended that you have a separate API that is between your back-end and final client. Or use Dgraph’s native GraphQL API (or use Slash Dgraph) with Auth. In the latter case, you can use any GraphQL client for RN.


But, Sunny, I have forgotten to mention a “way” to do this. I know that doing things is way better to learn something than just reading docs, posts, or videos.

If you are playing around with Dgraph, Dgraph has an HTTP endpoint so you can use any lib like “fetch”. There are just 2 main endpoints. “Mutate” and “query”. And you can also send queries in JSON format.

If you have questions about this API, just ask.


1 Like