# \#dgraph-js-http

**URL:** https://discuss.dgraph.io/tag/dgraph-js-http/92.md

[Latest](https://discuss.dgraph.io/latest.md) · [Categories](https://discuss.dgraph.io/categories.md) · [Tags](https://discuss.dgraph.io/tags.md)

---

## [The upsert and delete method in dgraph-js-http](https://discuss.dgraph.io/t/the-upsert-and-delete-method-in-dgraph-js-http/13340)

<div class="topic-metadata">

**Author:** [@littleone](https://discuss.dgraph.io/u/littleone)\
**Replies:** 3\
**Last updated:** [March 22, 2021, 4:50pm UTC](https://discuss.dgraph.io/t/the-upsert-and-delete-method-in-dgraph-js-http/13340 "2021-03-22T16:50:49Z")

</div>

I didn’t find the upsert and delete method in dgraph-js-http: export declare class Txn { private readonly dc; private readonly ctx; private finished; private mutated; constructor(dc: DgraphClient, o…

---

## [Problem with http client](https://discuss.dgraph.io/t/problem-with-http-client/13309)

<div class="topic-metadata">

**Author:** [@littleone](https://discuss.dgraph.io/u/littleone)\
**Replies:** 3\
**Last updated:** [March 20, 2021, 4:32pm UTC](https://discuss.dgraph.io/t/problem-with-http-client/13309 "2021-03-20T16:32:14Z")

</div>

after run a mutate, wether with dgraph-js-http or row http(postman), the response is success, and return a new uid. but I can’t get the new data by query operation, why is that? mutate: query: the params is v…

---

## [Next.js + pnpm + dgraph-js-http v20.07.2 = doesn’t work](https://discuss.dgraph.io/t/next-js-pnpm-dgraph-js-http-v20-07-2-doesn-t-work/11349)

<div class="topic-metadata">

**Author:** [@medrivia](https://discuss.dgraph.io/u/medrivia)\
**Replies:** 9\
**Last updated:** [November 14, 2020, 3:13am UTC](https://discuss.dgraph.io/t/next-js-pnpm-dgraph-js-http-v20-07-2-doesn-t-work/11349 "2020-11-14T03:13:19Z")

</div>

So, I recently tried to integrate my Next.js app with the recently updated dgraph-js-http@20.07.2. Here’s what I got: From CLI: SyntaxError: Unexpected token 'export' at wrapSafe (internal/modules/cjs/loader.js…

---

## [Is it possible to upsert using graph-js http client](https://discuss.dgraph.io/t/is-it-possible-to-upsert-using-graph-js-http-client/11353)

<div class="topic-metadata">

**Author:** [@amin](https://discuss.dgraph.io/u/amin)\
**Replies:** 4\
**Last updated:** [November 8, 2020, 3:46pm UTC](https://discuss.dgraph.io/t/is-it-possible-to-upsert-using-graph-js-http-client/11353 "2020-11-08T15:46:59Z")

</div>

Hello, I am trying to create an upsert with http client using the following code import { dgraphClient } from "./index"; const dgraph = require("dgraph-js-http"); const req = new dgraph.Request(); const query = \`qu…

---

## [How to add the tag without duplication?](https://discuss.dgraph.io/t/how-to-add-the-tag-without-duplication/11109)

<div class="topic-metadata">

**Author:** [@brainvader](https://discuss.dgraph.io/u/brainvader)\
**Replies:** 1\
**Last updated:** [October 24, 2020, 4:00pm UTC](https://discuss.dgraph.io/t/how-to-add-the-tag-without-duplication/11109 "2020-10-24T16:00:49Z")

</div>

Hello, guys. I’m creating a tiny blog system with Dgraph and Next.js. Saving the blog post, I post the following json object to PUT /api/posts/{uid} endpoint. { "uid": "0x3a992", "title": "This is title", "user"…

---

## [Update package for dgraph-js-http](https://discuss.dgraph.io/t/update-package-for-dgraph-js-http/10314)

<div class="topic-metadata">

**Author:** [@gotjoshua](https://discuss.dgraph.io/u/gotjoshua)\
**Replies:** 7\
**Last updated:** [September 27, 2020, 7:49pm UTC](https://discuss.dgraph.io/t/update-package-for-dgraph-js-http/10314 "2020-09-27T19:49:41Z")

</div>

I am trying to setup @auth directives and it seems that master is updated at: but even when i do: yarn add https://github.com/dgraph-io/dgraph-js-http I still get errors when trying to run the suggested command to re…

---

## [How to execute dgraph API in react-native app](https://discuss.dgraph.io/t/how-to-execute-dgraph-api-in-react-native-app/8598)

<div class="topic-metadata">

**Author:** [@sunny-mody](https://discuss.dgraph.io/u/sunny-mody)\
**Replies:** 2\
**Last updated:** [July 20, 2020, 12:45am UTC](https://discuss.dgraph.io/t/how-to-execute-dgraph-api-in-react-native-app/8598 "2020-07-20T00:45:39Z")

</div>

can someone please guide through or provide an example of how can I consume dgraph API in a react native app.

---

## [Vue component](https://discuss.dgraph.io/t/vue-component/7693)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [May 11, 2020, 11:12am UTC](https://discuss.dgraph.io/t/vue-component/7693 "2020-05-11T11:12:47Z")

</div>

Posted by ctwhome: 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”?

---

## [ERR\_NO\_CLIENTS with a DgraphClientStub provided](https://discuss.dgraph.io/t/err-no-clients-with-a-dgraphclientstub-provided/7691)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [April 28, 2020, 3:30pm UTC](https://discuss.dgraph.io/t/err-no-clients-with-a-dgraphclientstub-provided/7691 "2020-04-28T15:30:13Z")

</div>

Posted by zangornjak: 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 alph…

---

## [Support Access-Control-Allow-Credentials header](https://discuss.dgraph.io/t/support-access-control-allow-credentials-header/7683)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [December 20, 2019, 2:37pm UTC](https://discuss.dgraph.io/t/support-access-control-allow-credentials-header/7683 "2019-12-20T14:37:44Z")

</div>

Posted by praneshr: 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

---

## [Browser example : How to bundle the 'dgraph-js-http' lib in an HTML page](https://discuss.dgraph.io/t/browser-example-how-to-bundle-the-dgraph-js-http-lib-in-an-html-page/7690)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [November 22, 2019, 2:26pm UTC](https://discuss.dgraph.io/t/browser-example-how-to-bundle-the-dgraph-js-http-lib-in-an-html-page/7690 "2019-11-22T14:26:50Z")

</div>

Posted by hubyhuby: http1.zip There is an example for Node.js on server side that is working well. Now when you want to test it on the browser side the require directive is not reconised by the JS on the browser side…

---

## [How do we do upsert?](https://discuss.dgraph.io/t/how-do-we-do-upsert/7689)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [November 8, 2019, 12:57pm UTC](https://discuss.dgraph.io/t/how-do-we-do-upsert/7689 "2019-11-08T12:57:28Z")

</div>

Posted by srikoushik: I want to do a query and update a particular predicate.

---

## [Fix queryWithVars to handle UTF-8 values correctly](https://discuss.dgraph.io/t/fix-querywithvars-to-handle-utf-8-values-correctly/7685)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 6\
**Last updated:** [October 3, 2019, 1:27pm UTC](https://discuss.dgraph.io/t/fix-querywithvars-to-handle-utf-8-values-correctly/7685 "2019-10-03T13:27:27Z")

</div>

Posted by srfrog: 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 https://github.com/dgraph-io/dgra…

---

## [Update the library with new HTTP API](https://discuss.dgraph.io/t/update-the-library-with-new-http-api/7688)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [May 14, 2019, 2:40pm UTC](https://discuss.dgraph.io/t/update-the-library-with-new-http-api/7688 "2019-05-14T14:40:01Z")

</div>

Posted by mangalaman93: See this for more details https://github.com/dgraph-io/dgraph/pull/3365 & https://github.com/dgraph-io/dgraph/issues/3142

---

## [Problems using dgraph-js-http and dgraph-js with VUE](https://discuss.dgraph.io/t/problems-using-dgraph-js-http-and-dgraph-js-with-vue/7684)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [March 1, 2019, 5:53pm UTC](https://discuss.dgraph.io/t/problems-using-dgraph-js-http-and-dgraph-js-with-vue/7684 "2019-03-01T17:53:24Z")

</div>

Posted by erlendoverby: When importing dgraph-js or dgraph-js-http into VUE JS, I get errors. Environment: npm 6.3.0 vue-cli 3.0.0-rc.11 To replicate do the following: vue create dgraph\_project select manually (b…

---

## [Add a LRU cache for Client](https://discuss.dgraph.io/t/add-a-lru-cache-for-client/7686)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [March 1, 2019, 5:26pm UTC](https://discuss.dgraph.io/t/add-a-lru-cache-for-client/7686 "2019-03-01T17:26:33Z")

</div>

Posted by MichelDiz: 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

---

## [Remove LinRead from code](https://discuss.dgraph.io/t/remove-linread-from-code/7687)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [February 12, 2019, 1:24pm UTC](https://discuss.dgraph.io/t/remove-linread-from-code/7687 "2019-02-12T13:24:21Z")

</div>

Posted by MichelDiz: As LinRead ins’t been used by Dgraph anymore and is causing issues with CORS. Need to be cleanup.

---

## [Dgraph-ratel](https://discuss.dgraph.io/t/dgraph-ratel/7692)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [September 4, 2018, 2:25pm UTC](https://discuss.dgraph.io/t/dgraph-ratel/7692 "2018-09-04T14:25:43Z")

</div>

Posted by in0ig: From Installed Binary dgraph-ratel -version Ratel Version: localhost:8000 errot：We seem to have difficulties loading latest client. Try using the pac

---

## [setJson mutation failing APIError: Invalid mutation](https://discuss.dgraph.io/t/setjson-mutation-failing-apierror-invalid-mutation/7682)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [July 10, 2018, 5:56am UTC](https://discuss.dgraph.io/t/setjson-mutation-failing-apierror-invalid-mutation/7682 "2018-07-10T05:56:05Z")

</div>

Posted by chandu0101: 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…
