Best practice for NodeJS client development?

We have this example here GitHub - dgraph-io/graphoverflow: Run the entire StackOverflow on Dgraph. Work in progress.

It would be safer for you to create an API with Express and not link your project directly to Dgraph. Creating a NodeJS server (as API/REST) would be more interesting for better control of what is being inserted.

You could also create a GraphQL server GitHub - dpeek/dgraphql: DgraphQL: Build a GraphQL service from a schema