How to use dgraph-js-http - 7 common examples

To help you get started, we’ve selected a few dgraph-js-http examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dgraph-io / ratel / client / src / lib / helpers.js View on Github external
const createDgraphClient = memoizeOne(async url => {
    const stub = new dgraph.DgraphClientStub(url);
    try {
        await stub.detectApiVersion();
    } catch (err) {
        // Ignore error, it's probably a bad URL
    }

    return {
        client: new dgraph.DgraphClient(stub),
        stub,
    };
});
github dgraph-io / ratel / client / src / lib / helpers.js View on Github external
const createDgraphClient = memoizeOne(async url => {
    const stub = new dgraph.DgraphClientStub(url);
    try {
        await stub.detectApiVersion();
    } catch (err) {
        // Ignore error, it's probably a bad URL
    }

    return {
        client: new dgraph.DgraphClient(stub),
        stub,
    };
});
github dgraph-io / ratel / client / src / lib / helpers.js View on Github external
const createDgraphClient = memoizeOne(async url => {
    const stub = new dgraph.DgraphClientStub(url);
    try {
        await stub.detectApiVersion();
    } catch (err) {
        // Ignore error, it's probably a bad URL
    }

    return {
        client: new dgraph.DgraphClient(stub),
        stub,
    };
});
github dgraph-io / ratel / client / src / lib / helpers.js View on Github external
const createDgraphClient = memoizeOne(async url => {
    const stub = new dgraph.DgraphClientStub(url);
    try {
        await stub.detectApiVersion();
    } catch (err) {
        // Ignore error, it's probably a bad URL
    }

    return {
        client: new dgraph.DgraphClient(stub),
        stub,
    };
});
github dgraph-io / ratel / client / src / e2etests / puppetHelpers.js View on Github external
export const createHttpClient = async => {
    return new dgraph.DgraphClient(new dgraph.DgraphClientStub(DGRAPH_SERVER));
};
github dgraph-io / ratel / client / src / lib / helpers.js View on Github external
const createDgraphCluster = memoizeOne(async url => {
    const client = await getDgraphClient(url);
    return new dgraph.DgraphCluster(client);
});
github dgraph-io / ratel / client / src / lib / helpers.js View on Github external
const createDgraphZero = memoizeOne(async url => new dgraph.DgraphZero(url));

dgraph-js-http

A javascript HTTP client for Dgraph

Apache-2.0
Latest version published 1 year ago

Package Health Score

58 / 100
Full package analysis

Similar packages