Hi!
I have a question regarding overall API construction. I’m planning on using Dgraph as the core resource behind an application I’m working on but I also plan on “wrapping” the database in some additional functionality. To that end, I’m curious how to best go about the “wrapping.”
In order to provide programmatic access to third parties as well as my own UI, I see two initial approaches.
- Expose the
/graphql
endpoint directly
a. Pro: provides maximum flexibility
b. Con: reduces my “wrapper” API control and possibly faces limitations of GraphQL vs Dgraph’s GraphQL± which would be available through say a client library implementation (this second point I’m definitely not 100% on) - Create a wrapper REST API
a. Pro: greater “wrapper” API control, utilizes GraphQL± via a client library
b. Con: increases required changes as database/API change
This documentat points out that when Dgraph is launched, it provides a /graphql
endpoint that allows for unconstrained query/mutation operations to be run against the database using GraphQL. My core question is: what should I be considering when wrapping the Dgraph database with my own API?
I’m still in the process of familiarizing myself with the platform so any feedback, recommendations, clarifications, would be greatly appreciated. Thanks!
Best,
John