Options
All
  • Public
  • Public/Protected
  • All
Menu

External module CreateClient

Index

Functions

xCreateDgraphClient

  • xCreateDgraphClient has some smart defaults and takes optional config, returns a dgraphClient and dgraphClientStub.

    // No config required
    const { dgraphClient, dgraphClientStub } = xCreateDgraphClient()
    
    // The host and port are set to either the settings you passed in config, or the process or 9080, localhost
    const _port = port || process.env.DGRAPH_PORT || 9080;
    const _host = host || process.env.DGRAPH_HOST || 'localhost';

    Parameters

    • Optional config: ICreateDgraphClientConfig
    • Default value _dgraph: any = dgraph
    • Default value infoLog: info = console.info

    Returns ICreateDGraph

Generated using TypeDoc