# \#dgraph-js

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

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

---

## [Error when running query with @id](https://discuss.dgraph.io/t/error-when-running-query-with-id/17260)

<div class="topic-metadata">

**Author:** [@vireakvibol](https://discuss.dgraph.io/u/vireakvibol)\
**Replies:** 3\
**Last updated:** [May 5, 2022, 11:00am UTC](https://discuss.dgraph.io/t/error-when-running-query-with-id/17260 "2022-05-05T11:00:31Z")

</div>

I try to use dgraphjs and alter the schema with query bellow type user { username: String! @id } got the error Expected new line after field declaration. Got @ anyway running on dgraph cloud dashboard with sche…

---

## [Propose to use @grpc/grpc-js instead of grpc that currently will not be maintain in the near future](https://discuss.dgraph.io/t/propose-to-use-grpc-grpc-js-instead-of-grpc-that-currently-will-not-be-maintain-in-the-near-future/17228)

<div class="topic-metadata">

**Author:** [@vireakvibol](https://discuss.dgraph.io/u/vireakvibol)\
**Replies:** 1\
**Last updated:** [April 29, 2022, 12:09am UTC](https://discuss.dgraph.io/t/propose-to-use-grpc-grpc-js-instead-of-grpc-that-currently-will-not-be-maintain-in-the-near-future/17228 "2022-04-29T00:09:02Z")

</div>

What Dgraph client (and version) are you using? v21.3.1 (put “x” in the box to select) Dgo PyDgraph Dgraph4J Dgraph-js Dgraph-js-http Dgraph.NET Hello currently by default dgraph-js using grpc as dependency. …

---

## [Do dgraph js clients support any sort of error handling for set, delete, upsert operations?](https://discuss.dgraph.io/t/do-dgraph-js-clients-support-any-sort-of-error-handling-for-set-delete-upsert-operations/16020)

<div class="topic-metadata">

**Author:** [@samadadi](https://discuss.dgraph.io/u/samadadi)\
**Replies:** 0\
**Last updated:** [November 10, 2021, 9:48pm UTC](https://discuss.dgraph.io/t/do-dgraph-js-clients-support-any-sort-of-error-handling-for-set-delete-upsert-operations/16020 "2021-11-10T21:48:16Z")

</div>

There is no error management section for js client’s github page. I have some question related to error handling in dgraph: How to know if there is an error for an operation(set, delete, update, …)? Does server return…

---

## [RFC: enhancement over dgraph schema](https://discuss.dgraph.io/t/rfc-enhancement-over-dgraph-schema/8195)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 9\
**Last updated:** [February 15, 2021, 6:25am UTC](https://discuss.dgraph.io/t/rfc-enhancement-over-dgraph-schema/8195 "2021-02-15T06:25:13Z")

</div>

Moved from GitHub dgraph-js/117 Posted by shreyansh-zazz: Overview Users should be able to define DGraph schema in object format. Defining schema in an object format will enable us to provide more validations to the s…

---

## [Multiple Mutation Blocks - dgraph-js support](https://discuss.dgraph.io/t/multiple-mutation-blocks-dgraph-js-support/12684)

<div class="topic-metadata">

**Author:** [@Jesus\_Soto](https://discuss.dgraph.io/u/Jesus_Soto)\
**Replies:** 0\
**Last updated:** [February 7, 2021, 7:19pm UTC](https://discuss.dgraph.io/t/multiple-mutation-blocks-dgraph-js-support/12684 "2021-02-07T19:19:37Z")

</div>

Hello there! I want to run a conditional upsert as shown in the example below: curl -H "Content-Type: application/rdf" -X POST localhost:8080/mutate?commitNow=true -d $' upsert { query { # filter is needed to ens…

---

## [Is the grpc peerDependency still required?](https://discuss.dgraph.io/t/is-the-grpc-peerdependency-still-required/12381)

<div class="topic-metadata">

**Author:** [@dpk](https://discuss.dgraph.io/u/dpk)\
**Replies:** 1\
**Last updated:** [January 21, 2021, 1:31am UTC](https://discuss.dgraph.io/t/is-the-grpc-peerdependency-still-required/12381 "2021-01-21T01:31:49Z")

</div>

This is neither a bug report nor a feature request. Is the grpc peer dependency still required? It looks like dgraph-js has fully moved on to @grpc/grpc-js in all but the README and peerDependencies object. If not, coul…

---

## [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"…

---

## [Connection management](https://discuss.dgraph.io/t/connection-management/11060)

<div class="topic-metadata">

**Author:** [@tron](https://discuss.dgraph.io/u/tron)\
**Replies:** 1\
**Last updated:** [October 21, 2020, 3:20pm UTC](https://discuss.dgraph.io/t/connection-management/11060 "2020-10-21T15:20:06Z")

</div>

I’m developing a typical API server (Node.js with Apollo), and I’m using the JavaScript gRPC client to interface with Dgraph. I’d like to understand how to properly manage the lifecycle of Dgraph connections. I was spec…

---

## [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…

---

## [Dgraph-js does not offer graceful way to failover client endpoints/stubs](https://discuss.dgraph.io/t/dgraph-js-does-not-offer-graceful-way-to-failover-client-endpoints-stubs/10123)

<div class="topic-metadata">

**Author:** [@savearray2](https://discuss.dgraph.io/u/savearray2)\
**Replies:** 3\
**Last updated:** [September 9, 2020, 1:58pm UTC](https://discuss.dgraph.io/t/dgraph-js-does-not-offer-graceful-way-to-failover-client-endpoints-stubs/10123 "2020-09-09T13:58:37Z")

</div>

I’m getting ready to use Dgraph in production, but have run into the following issue: I currently have a geographically distributed Dgraph cluster over several continents. At any point in time, one or more servers in th…

---

## [How do i drop data using the js library?](https://discuss.dgraph.io/t/how-do-i-drop-data-using-the-js-library/9744)

<div class="topic-metadata">

**Author:** [@scroobius-pip](https://discuss.dgraph.io/u/scroobius-pip)\
**Replies:** 2\
**Last updated:** [September 4, 2020, 11:25am UTC](https://discuss.dgraph.io/t/how-do-i-drop-data-using-the-js-library/9744 "2020-09-04T11:25:18Z")

</div>

According to this other discussion: Drop all data from Dgraph - Users / Dgraph - Discuss Dgraph curl -X POST localhost:8080/alter -d '{"drop\_op": "DATA"}' is the way to drop data without schema, but what’s the equival…

---

## [Best practice for DgraphClientStub, DgraphClient lifetime](https://discuss.dgraph.io/t/best-practice-for-dgraphclientstub-dgraphclient-lifetime/9738)

<div class="topic-metadata">

**Author:** [@clintwood](https://discuss.dgraph.io/u/clintwood)\
**Replies:** 4\
**Last updated:** [September 1, 2020, 8:32am UTC](https://discuss.dgraph.io/t/best-practice-for-dgraphclientstub-dgraphclient-lifetime/9738 "2020-09-01T08:32:45Z")

</div>

I’ve not been able to find any guidance on a best practice for a request lifetime with respect to DgraphClientStub, DgraphClient within the context of a server process. Given a node server with a module that implements …

---

## [API is not ergonomic](https://discuss.dgraph.io/t/api-is-not-ergonomic/8178)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 5\
**Last updated:** [July 11, 2020, 7:16am UTC](https://discuss.dgraph.io/t/api-is-not-ergonomic/8178 "2020-07-11T07:16:01Z")

</div>

Moved from GitHub dgraph-js/62 Posted by felixfbecker: It seems like the API is purely a generated gRPC client. This makes it very unergonomic for JavaScript in many places: None of the classes have constructors. For…

---

## [Module import requires unsafe-eval in script content security policy directive](https://discuss.dgraph.io/t/module-import-requires-unsafe-eval-in-script-content-security-policy-directive/8194)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [April 28, 2020, 3:27pm UTC](https://discuss.dgraph.io/t/module-import-requires-unsafe-eval-in-script-content-security-policy-directive/8194 "2020-04-28T15:27:15Z")

</div>

Moved from GitHub dgraph-js/115 Posted by zangornjak: I’m trying to import the module in an Electron application with a recommended Content Security Policy of script-src 'self' but it prevents loading of the module wit…

---

## [Can't run multiple mutations in same transaction](https://discuss.dgraph.io/t/cant-run-multiple-mutations-in-same-transaction/8193)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [April 12, 2020, 11:45pm UTC](https://discuss.dgraph.io/t/cant-run-multiple-mutations-in-same-transaction/8193 "2020-04-12T23:45:03Z")

</div>

Moved from GitHub dgraph-js/113 Posted by benwerner01: I’m trying to run multiple mutations in the same transaction. To my understanding something like this should work: runMutations = async (mutations: DGraphJS.Mutat…

---

## [When running a mutation unable to get the response in JSON](https://discuss.dgraph.io/t/when-running-a-mutation-unable-to-get-the-response-in-json/8192)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [April 7, 2020, 2:34pm UTC](https://discuss.dgraph.io/t/when-running-a-mutation-unable-to-get-the-response-in-json/8192 "2020-04-07T14:34:02Z")

</div>

Moved from GitHub dgraph-js/112 Posted by shreyansh-zazz: I have added comments: const dgraph = require('dgraph-js'); const dgraphClient = require('../../config/config').dgraph.client; module.exports = { adduser: a…

---

## [GRPC Error on many simultaneous connections](https://discuss.dgraph.io/t/grpc-error-on-many-simultaneous-connections/8191)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 5\
**Last updated:** [April 2, 2020, 5:13pm UTC](https://discuss.dgraph.io/t/grpc-error-on-many-simultaneous-connections/8191 "2020-04-02T17:13:06Z")

</div>

Moved from GitHub dgraph-js/109 Posted by paulrostorp: Hi all, I’m getting Error: 14 UNAVAILABLE: Received RST\_STREAM with error code 7 When running a high number of parallel queries using the dgraph-js client. I ge…

---

## [TypeError: Channel's second argument must be a ChannelCredentials](https://discuss.dgraph.io/t/typeerror-channels-second-argument-must-be-a-channelcredentials/8129)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 3\
**Last updated:** [January 23, 2020, 5:00am UTC](https://discuss.dgraph.io/t/typeerror-channels-second-argument-must-be-a-channelcredentials/8129 "2020-01-23T05:00:04Z")

</div>

Moved from GitHub dgraph-js/7 Posted by MichelDiz: I can use it perfectly without setting the credentials for gRPC. But I do not know if that would be a problem. const clientStub = new dgraph.DgraphClientStub( // ad…

---

## [Dgraph unique identifier](https://discuss.dgraph.io/t/dgraph-unique-identifier/8190)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [January 17, 2020, 8:40am UTC](https://discuss.dgraph.io/t/dgraph-unique-identifier/8190 "2020-01-17T08:40:24Z")

</div>

Moved from GitHub dgraph-js/102 Posted by xSequential: I am using dgraph with an apollo server in front of it. In Apollo I plan to maintain a unique identifier for each user in my dgraph db. Is the UID appropriate for…

---

## [Cleaning up after performing an Operation](https://discuss.dgraph.io/t/cleaning-up-after-performing-an-operation/8165)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [December 20, 2019, 2:32pm UTC](https://discuss.dgraph.io/t/cleaning-up-after-performing-an-operation/8165 "2019-12-20T14:32:21Z")

</div>

Moved from GitHub dgraph-js/44 Posted by aryzing: The Readme discusses how to perform and clean up after transactions, but only discusses how to perform operations, such as updating the schema. In production, is it nec…

---

## [Upsert should always return the uid](https://discuss.dgraph.io/t/upsert-should-always-return-the-uid/8182)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 3\
**Last updated:** [December 10, 2019, 10:27am UTC](https://discuss.dgraph.io/t/upsert-should-always-return-the-uid/8182 "2019-12-10T10:27:29Z")

</div>

Moved from GitHub dgraph-js/73 Posted by pepoospina: Experience Report What you wanted to do I am using an upsert operation as described in dgraph-js to get or create a new node with a given external id called did and …

---

## [Add tests for upsert with graphql variables](https://discuss.dgraph.io/t/add-tests-for-upsert-with-graphql-variables/8189)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [December 9, 2019, 1:11pm UTC](https://discuss.dgraph.io/t/add-tests-for-upsert-with-graphql-variables/8189 "2019-12-09T13:11:28Z")

</div>

Moved from GitHub dgraph-js/100 Posted by prashant-shahi: We should have test cases for upsert with GraphQL variables for both set and delete mutations, to be sure that everything works as it should.

---

## [Update test cases to support multiple mutations](https://discuss.dgraph.io/t/update-test-cases-to-support-multiple-mutations/8188)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [November 22, 2019, 12:15pm UTC](https://discuss.dgraph.io/t/update-test-cases-to-support-multiple-mutations/8188 "2019-11-22T12:15:40Z")

</div>

Moved from GitHub dgraph-js/95 Posted by prashant-shahi: Test cases of doRequest are failing in Dgraph master with the following error message. \[17:07:12\]FAIL tests/integration/doRequest.spec.ts \[17:07:12\] ● doReques…

---

## [Documentation on pre-v7.6 examples should be removed](https://discuss.dgraph.io/t/documentation-on-pre-v7-6-examples-should-be-removed/8187)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [October 10, 2019, 10:10am UTC](https://discuss.dgraph.io/t/documentation-on-pre-v7-6-examples-should-be-removed/8187 "2019-10-10T10:10:28Z")

</div>

Moved from GitHub dgraph-js/88 Posted by paulftw: examples/simple has index-pre-v7.6.js according to docs it’s for versions of node from 2017. We don’t offer legacy code for other examples Support for all obsolete no…

---

## [Simple example throws error: "Missing colon in type declaration."](https://discuss.dgraph.io/t/simple-example-throws-error-missing-colon-in-type-declaration/8186)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 6\
**Last updated:** [October 9, 2019, 10:49am UTC](https://discuss.dgraph.io/t/simple-example-throws-error-missing-colon-in-type-declaration/8186 "2019-10-09T10:49:55Z")

</div>

Moved from GitHub dgraph-js/87 Posted by alexnitta: When I follow the instructions in dgraph-js/examples/simple/README.md, I get this error when running node index.js: ERROR: { Error: 2 UNKNOWN: line 3 column 16: Mis…

---

## [Uncaught error - when ACL feature is turned on, and login credentials not passed](https://discuss.dgraph.io/t/uncaught-error-when-acl-feature-is-turned-on-and-login-credentials-not-passed/8180)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 2\
**Last updated:** [October 1, 2019, 4:26pm UTC](https://discuss.dgraph.io/t/uncaught-error-when-acl-feature-is-turned-on-and-login-credentials-not-passed/8180 "2019-10-01T16:26:05Z")

</div>

Moved from GitHub dgraph-js/71 Posted by prashant-shahi: When I ran the example script against dgraph cluster with ACL feature turned on, I encountered the following error, which wasn’t of much help. ERROR: TypeError…

---

## [TypeError: Cannot read property "serializeBinary" of undefined](https://discuss.dgraph.io/t/typeerror-cannot-read-property-serializebinary-of-undefined/8185)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [September 30, 2019, 8:51am UTC](https://discuss.dgraph.io/t/typeerror-cannot-read-property-serializebinary-of-undefined/8185 "2019-09-30T08:51:34Z")

</div>

Moved from GitHub dgraph-js/83 Posted by scroobius-pip: versions: dgraph-js: 2.0.1 grpc: 1.24.0 dgraph: 1.1.0 Coded using the 1.X.Y dgraph-js library with dgraph 1.0.1 , then i update the library and database to th…

---

## [Upgrade google-protobuf dependency version to 3.8.0+](https://discuss.dgraph.io/t/upgrade-google-protobuf-dependency-version-to-3-8-0/8184)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 0\
**Last updated:** [September 25, 2019, 5:08am UTC](https://discuss.dgraph.io/t/upgrade-google-protobuf-dependency-version-to-3-8-0/8184 "2019-09-25T05:08:25Z")

</div>

Moved from GitHub dgraph-js/80 Posted by lhr0909: We have encountered an issue with the generated grpc files in the 2.0.1 npm lib where it is using features that only exist in google-protobuf@3.8.0+. https://github.co…

---

## [Mutate is not part of dgraph.API as of v1.1.0](https://discuss.dgraph.io/t/mutate-is-not-part-of-dgraph-api-as-of-v1-1-0/8183)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [September 15, 2019, 12:47pm UTC](https://discuss.dgraph.io/t/mutate-is-not-part-of-dgraph-api-as-of-v1-1-0/8183 "2019-09-15T12:47:12Z")

</div>

Moved from GitHub dgraph-js/74 Posted by markmssd: I’m using the sample test file to run e2e tests. However, something is off in this simple test file when using DGraph v1.1.0: https://github.com/dgraph-io/dgraph-js/…

[Next page](https://discuss.dgraph.io/tag/dgraph-js/134.md?match_all_tags=true&page=1&tags%5B%5D=dgraph-js)
