Does Dgraph support Dgraph Module for Nestjs?

Hello im new in Dgraph.
When i tried to inject Dgraph as a module in Nestjs, I can see Dgraph does not support for module.
So i want to recommended Dgraph should support it.
It’s seem like

export declare class DgraphModule { 
    static register(options: DgraphModuleOptions): DynamicModule; 
    static registerAsync(options: DgraphModuleAsyncOptions): DynamicModule; 
    private static createAsyncProviders; 
    private static createAsyncOptionsProvider; 
}

So it can be use in Nestjs be like:

DgraphModule.registerAsync({ 
useFactory: async (configService: ConfigService) => ({ 
    stub: [ 
       { address: configService.get('DGRAPH_URL') }
    ], 
    debug: true  
  } ), 
  inject: [ConfigService] }
)

Its seem like some one write a library for it :
ref:https://github.com/val-samonte/nestjs-dgraph-example
But it does not support resignterAsync so can’t move url of Dgraph to env config. And it’s using Dgraph v1.2.1.
Nestjs and Dgraph are so powerful, i hope they can support each others more.

2 Likes