Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
};
});
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,
};
});
export const createHttpClient = async => {
return new dgraph.DgraphClient(new dgraph.DgraphClientStub(DGRAPH_SERVER));
};