dgraph-io / dgraph-js-http Goto Github PK
View Code? Open in Web Editor NEWA JavaScript HTTP client for Dgraph
License: Apache License 2.0
A JavaScript HTTP client for Dgraph
License: Apache License 2.0
Similar to it would be fantastic to have a component that could run queries and mutations in the same fashion, but with a much cleaning code.
How hard would it be to wrap this "dgraph-js-http"?
See this for more details dgraph-io/dgraph#3365 & dgraph-io/dgraph#3142
Apparently queryWithVars
is altering the content of vars with UTF-8 strings when passing them to Dgraph. The main culprit seems to be the toString()
method.
Reference dgraph-io/dgraph#2803
I want to do a query and update a particular predicate.
There is an example for Node.js on server side that is working well.
https://github.com/dgraph-io/dgraph-js-http/tree/master/examples/simple
Now when you want to test it on the browser side the require directive is not reconised by the JS on the browser side. " const dgraph = require("dgraph-js-http"); " gives an error.
I manage to use a "bundler " and got to the next series of problems ;)
Could you please provide with an example ?
This worked a little :
browserify index-promise.js > bundle.js
Provide a way to define credentials: 'include'
to the isomorphic-fetch
.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
To reduce the overhead and increase performance.
e.g: http://avoidwork.github.io/tiny-lru/
Or any other in this list https://github.com/dominictarr/bench-lru
Running npm install
on current package gives unresolved peer dependency:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/tslint
npm ERR! dev tslint@"^6.1.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer tslint@"^5.1.0" from [email protected]
npm ERR! node_modules/tslint-microsoft-contrib
npm ERR! dev tslint-microsoft-contrib@"^6.2.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/tslint
npm ERR! peer tslint@"^5.1.0" from [email protected]
npm ERR! node_modules/tslint-microsoft-contrib
npm ERR! dev tslint-microsoft-contrib@"^6.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Hence why we currently require npm install --legacy-peer-deps
. This is because https://github.com/microsoft/tslint-microsoft-contrib is out of date and no longer maintained. We should switch to a more modern linter. Perhaps https://github.com/typescript-eslint/typescript-eslint.
I'm trying to use the module in an Electron application but I get the ERR_NO_CLIENTS: Error: No clients provided in DgraphClient constructor
error. The DgraphClientStub
however is provided and alpha / zero
are both running and reachable through ratel
.
const dgraph = require('dgraph-js-http')
const dgraphClientStub = new dgraph.DgraphClientStub()
const dgraphClient = new dgraph.DgraphClient(dgraphClientStub)
console.log(dgraph, dgraphClient, dgraphClientStub)
I've tried with the latest version "dgraph-js-http": "20.3.0"
and branch v1.1.0-rc2 "dgraph-js-http": "file:/./build-steps/dgraph-js-http-1.1.0-rc2"
.
From Installed Binary
Ratel Version:
localhost:8000
errot:We seem to have difficulties loading latest client. Try using the pac
val txn = ctx.dgraph.newTxn()
val o = json(name = arg.input.name)
txn.mutate(DgraphMutation( setJson = o ))
above code is scala.js
Error :
APIError: Invalid mutation.
Note: setNquads
is working fine ...
When importing dgraph-js or dgraph-js-http into VUE JS, I get errors.
vue create dgraph_project
cd dgraph_project
yarn add dgraph-js-http grpc dgraph-js
Add the following to the src/main.js file
import dgraph from 'dgraph-js'
yarn serve
Goto http://localhost:8080/ and check the console log in the browser.
TypeError: process.version is undefined
[Vue warn]: Error in render: "TypeError: dgraph_js_http__WEBPACK_IMPORTED_MODULE_0___default.a is undefined"
When I try to invoke the library by running the simple example.
I suspect that the use webpack 4 might be the reason for this problem.
However, I would appreciate if the dgraph-js library could work "out of the box" with vue-cli v3 and webpack 4.
Sorry for the trouble.
As LinRead ins't been used by Dgraph anymore and is causing issues with CORS. Need to be cleanup.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.