# GraphQL

**URL:** https://discuss.dgraph.io/c/user/graphql/28.md

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

---

## [About the GraphQL category](https://discuss.dgraph.io/t/about-the-graphql-category/6562)

<div class="topic-metadata">

**Author:** [@dmai](https://discuss.dgraph.io/u/dmai)\
**Replies:** 0

</div>

Discussion about Dgraph GraphQL.

---

## [How to efficiently find shortest and longest paths between node types in Dgraph (similar to APOC in Neo4j)?](https://discuss.dgraph.io/t/how-to-efficiently-find-shortest-and-longest-paths-between-node-types-in-dgraph-similar-to-apoc-in-neo4j/19933)

<div class="topic-metadata">

**Author:** [@rg2609](https://discuss.dgraph.io/u/rg2609)\
**Replies:** 4\
**Last updated:** [October 3, 2025, 11:00am UTC](https://discuss.dgraph.io/t/how-to-efficiently-find-shortest-and-longest-paths-between-node-types-in-dgraph-similar-to-apoc-in-neo4j/19933 "2025-10-03T11:00:03Z")

</div>

I’m trying to find the shortest and longest path between two node types across the entire graph in Dgraph, similar to how it’s done using APOC in Neo4j. In Neo4j, I can use a single query like this: MATCH (start: \`ntyp…

---

## [Dgraph query to fetch all possible paths between two node types with depth limit](https://discuss.dgraph.io/t/dgraph-query-to-fetch-all-possible-paths-between-two-node-types-with-depth-limit/19997)

<div class="topic-metadata">

**Author:** [@rg2609](https://discuss.dgraph.io/u/rg2609)\
**Replies:** 3\
**Last updated:** [September 15, 2025, 7:48pm UTC](https://discuss.dgraph.io/t/dgraph-query-to-fetch-all-possible-paths-between-two-node-types-with-depth-limit/19997 "2025-09-15T19:48:19Z")

</div>

I’m working with a Dgraph dataset where nodes have different types and are connected by a RELATED\_TO edge with facets. Here’s a simplified version of the dataset: \_:node\_11 \<dgraph.type\> "Node\_Type1" . \_:node\_11 \<name\> …

---

## [Why does Dgraph shortest path return more hops than Neo4j for the same data and how to get Neo4j-like paths in Dgraph?](https://discuss.dgraph.io/t/why-does-dgraph-shortest-path-return-more-hops-than-neo4j-for-the-same-data-and-how-to-get-neo4j-like-paths-in-dgraph/19922)

<div class="topic-metadata">

**Author:** [@janakmistry](https://discuss.dgraph.io/u/janakmistry)\
**Replies:** 5\
**Last updated:** [July 2, 2025, 5:12pm UTC](https://discuss.dgraph.io/t/why-does-dgraph-shortest-path-return-more-hops-than-neo4j-for-the-same-data-and-how-to-get-neo4j-like-paths-in-dgraph/19922 "2025-07-02T17:12:41Z")

</div>

I’m working with both Dgraph and Neo4j to find the shortest path between two nodes in a graph. However, I’m seeing different results in terms of path length (number of hops) for what should be the same data and relations…

---

## [Problem ith my Dgraph deployment on a MicroK8s cluster](https://discuss.dgraph.io/t/problem-ith-my-dgraph-deployment-on-a-microk8s-cluster/19834)

<div class="topic-metadata">

**Author:** [@SOPORTE](https://discuss.dgraph.io/u/SOPORTE)\
**Replies:** 1\
**Last updated:** [March 28, 2025, 4:10pm UTC](https://discuss.dgraph.io/t/problem-ith-my-dgraph-deployment-on-a-microk8s-cluster/19834 "2025-03-28T16:10:17Z")

</div>

I am facing an issue with my Dgraph deployment on a MicroK8s cluster. Below are the key points: Connection with Dgraph Zero The pod e360-dgraph-alpha-0 successfully connects to the pod e360-dgraph-zero-0, as shown in th…

---

## [Intro to Dgraph Vector Embeddings](https://discuss.dgraph.io/t/intro-to-dgraph-vector-embeddings/19598)

<div class="topic-metadata">

**Author:** [@matthewmcneely](https://discuss.dgraph.io/u/matthewmcneely)\
**Replies:** 4\
**Last updated:** [March 17, 2025, 10:45pm UTC](https://discuss.dgraph.io/t/intro-to-dgraph-vector-embeddings/19598 "2025-03-17T22:45:55Z")

</div>

Hey Everyone. I made a video introduction to using Dgraph Vector Embeddings (GraphQL version). If you’ve been putting off checking out vector embeddings (like I had), this is a great introduction. I’ve created a self-con…

---

## [How do I specify UID？](https://discuss.dgraph.io/t/how-do-i-specify-uid/10284)

<div class="topic-metadata">

**Author:** [@Soultrans](https://discuss.dgraph.io/u/Soultrans)\
**Replies:** 10\
**Last updated:** [January 4, 2025, 6:29pm UTC](https://discuss.dgraph.io/t/how-do-i-specify-uid/10284 "2025-01-04T18:29:50Z")

</div>

Hi，I have a problem with Pydgraph.I need to specify the Uid.But I found that the UID of the node I specified still seemed to conflict with the system generated.How is UID generated？ For example: I set item = { …

---

## [Need to pass variable in custom DQL query](https://discuss.dgraph.io/t/need-to-pass-variable-in-custom-dql-query/19672)

<div class="topic-metadata">

**Author:** [@himanshu-msphere](https://discuss.dgraph.io/u/himanshu-msphere)\
**Replies:** 0\
**Last updated:** [December 20, 2024, 6:49am UTC](https://discuss.dgraph.io/t/need-to-pass-variable-in-custom-dql-query/19672 "2024-12-20T06:49:40Z")

</div>

Hello, I use custom DQL query for graphql which schema as below type ReturnData @remote { name: String count: Int } type Attributemap @remote { groupby: \[ReturnData\] @remoteResponse(name: "@groupby") } type Query…

---

## [Graphql query count for get product count](https://discuss.dgraph.io/t/graphql-query-count-for-get-product-count/19654)

<div class="topic-metadata">

**Author:** [@himanshu-msphere](https://discuss.dgraph.io/u/himanshu-msphere)\
**Replies:** 2\
**Last updated:** [December 12, 2024, 5:22am UTC](https://discuss.dgraph.io/t/graphql-query-count-for-get-product-count/19654 "2024-12-12T05:22:30Z")

</div>

Hello, I am facing an issue while querying my product data using GraphQL in relation to filtered aggregation counts. interface product { id: ID! name: String! @id @search(by: \[regexp\]) sku: String @search(by: \[re…

---

## [Using @auth and @custom dql?](https://discuss.dgraph.io/t/using-auth-and-custom-dql/19648)

<div class="topic-metadata">

**Author:** [@miko](https://discuss.dgraph.io/u/miko)\
**Replies:** 0\
**Last updated:** [December 10, 2024, 3:46pm UTC](https://discuss.dgraph.io/t/using-auth-and-custom-dql/19648 "2024-12-10T15:46:58Z")

</div>

Hello, I am using graphql schema with types using @auth RBAC rules for queries. However when I want to use @custom DQL query (even when it returns the same type), the acl rules are not used. So i can get filtered resul…

---

## [The --upsertPredicate flag is ignored during JSON live upload](https://discuss.dgraph.io/t/the-upsertpredicate-flag-is-ignored-during-json-live-upload/19646)

<div class="topic-metadata">

**Author:** [@Sergey\_Babinskiy](https://discuss.dgraph.io/u/Sergey_Babinskiy)\
**Replies:** 2\
**Last updated:** [December 10, 2024, 2:42pm UTC](https://discuss.dgraph.io/t/the-upsertpredicate-flag-is-ignored-during-json-live-upload/19646 "2024-12-10T14:42:06Z")

</div>

I’m running a local standalone dgraph instance using the latest docker container. Then I upload a GraphQL schema using ❯ curl -X POST localhost:8080/admin/schema --data-binary '@schema.graphqls' The schema looks like: …

---

## [Need to get details from hierarchy level data](https://discuss.dgraph.io/t/need-to-get-details-from-hierarchy-level-data/19639)

<div class="topic-metadata">

**Author:** [@himanshu-msphere](https://discuss.dgraph.io/u/himanshu-msphere)\
**Replies:** 3\
**Last updated:** [December 6, 2024, 5:36pm UTC](https://discuss.dgraph.io/t/need-to-get-details-from-hierarchy-level-data/19639 "2024-12-06T17:36:58Z")

</div>

Hello, I create new Category type DQL schema as below. Need to set category as hierarchy level type Category { name: String! @id @search(by: \[regexp\]) position: Int @default(add: { value: 0}) parent: Category s…

---

## [Is it possible to use "space" in enum？](https://discuss.dgraph.io/t/is-it-possible-to-use-space-in-enum/16407)

<div class="topic-metadata">

**Author:** [@ansonhwang](https://discuss.dgraph.io/u/ansonhwang)\
**Replies:** 4\
**Last updated:** [December 6, 2024, 10:17am UTC](https://discuss.dgraph.io/t/is-it-possible-to-use-space-in-enum/16407 "2024-12-06T10:17:48Z")

</div>

Is it possible to use “space” in enum？ My use case is enum CountryName{ "United States" Italy ect... }

---

## [Introducing Nested Filtering for Dgraph GraphQL API with Optimized Query Support](https://discuss.dgraph.io/t/introducing-nested-filtering-for-dgraph-graphql-api-with-optimized-query-support/19343)

<div class="topic-metadata">

**Author:** [@iyinoluwaayoola](https://discuss.dgraph.io/u/iyinoluwaayoola)\
**Replies:** 3\
**Last updated:** [December 5, 2024, 9:17am UTC](https://discuss.dgraph.io/t/introducing-nested-filtering-for-dgraph-graphql-api-with-optimized-query-support/19343 "2024-12-05T09:17:39Z")

</div>

I’ve added nested filtering to the generated GraphQL API for Dgraph and would like to request for feedback and help with user or unit testing. How Does It Work? This feature leverages Dgraph’s var block to filter nes…

---

## [Can you specify one type to require fields of another type in schema](https://discuss.dgraph.io/t/can-you-specify-one-type-to-require-fields-of-another-type-in-schema/19609)

<div class="topic-metadata">

**Author:** [@reasley](https://discuss.dgraph.io/u/reasley)\
**Replies:** 4\
**Last updated:** [November 21, 2024, 9:35pm UTC](https://discuss.dgraph.io/t/can-you-specify-one-type-to-require-fields-of-another-type-in-schema/19609 "2024-11-21T21:35:50Z")

</div>

type Coordinate{ id: ID! xid: String! @id lon: Float! lat: Float! hae: Float ce: Float le: Float } type Point{ id: ID! xid: String! @id type: String! @default(value: “point”) coordinates: Coordinate! } typ…

---

## [Recursive GraphQL Queries](https://discuss.dgraph.io/t/recursive-graphql-queries/19356)

<div class="topic-metadata">

**Author:** [@Sultan\_Nasyrov](https://discuss.dgraph.io/u/Sultan_Nasyrov)\
**Replies:** 3\
**Last updated:** [July 13, 2024, 7:25am UTC](https://discuss.dgraph.io/t/recursive-graphql-queries/19356 "2024-07-13T07:25:01Z")

</div>

I’m using dgraph to store tree data structure. Here is my graphql schema. type Node { title: String! parent: PalaceNode children: \[PalaceNode\] @hasInverse(field: parent) } I want to fetch all ancestors for …

---

## [How can I return all nodes of a certain type?](https://discuss.dgraph.io/t/how-can-i-return-all-nodes-of-a-certain-type/19320)

<div class="topic-metadata">

**Author:** [@JourneyToSilius](https://discuss.dgraph.io/u/JourneyToSilius)\
**Replies:** 4\
**Last updated:** [May 29, 2024, 8:39pm UTC](https://discuss.dgraph.io/t/how-can-i-return-all-nodes-of-a-certain-type/19320 "2024-05-29T20:39:52Z")

</div>

I have just made my first inserts with the Go client, and the data is being inserted I can query like this by the latest inserted uid and I get the data from this node : { node(func: uid(0x49)) { expand(DummyType…

---

## [Implementing Filesystem like Graph System. How to fully get back tree without writing a ton of graphql code?](https://discuss.dgraph.io/t/implementing-filesystem-like-graph-system-how-to-fully-get-back-tree-without-writing-a-ton-of-graphql-code/19300)

<div class="topic-metadata">

**Author:** [@jakeecolution](https://discuss.dgraph.io/u/jakeecolution)\
**Replies:** 4\
**Last updated:** [April 29, 2024, 8:14pm UTC](https://discuss.dgraph.io/t/implementing-filesystem-like-graph-system-how-to-fully-get-back-tree-without-writing-a-ton-of-graphql-code/19300 "2024-04-29T20:14:17Z")

</div>

Hello! Here is my example schema: enum NodeType { Folder File Root } type FSNode { uuid: String! @id name: String! @search permissions: Int! kind: NodeType! document: String # stringified blog if file …

---

## [How can I get random data with DQL](https://discuss.dgraph.io/t/how-can-i-get-random-data-with-dql/13244)

<div class="topic-metadata">

**Author:** [@koculu](https://discuss.dgraph.io/u/koculu)\
**Replies:** 6\
**Last updated:** [April 3, 2024, 11:52am UTC](https://discuss.dgraph.io/t/how-can-i-get-random-data-with-dql/13244 "2024-04-03T11:52:00Z")

</div>

I want to get randomized data from a graph database. Type Person { name } Can you please guide if there is an efficient DQL query to fetch random 100 person from the database? Second Question (nice to have featur…

---

## [What's the best way to support transactions with graphql (using shurcool's golang client)](https://discuss.dgraph.io/t/whats-the-best-way-to-support-transactions-with-graphql-using-shurcools-golang-client/19256)

<div class="topic-metadata">

**Author:** [@Rohan\_Surana](https://discuss.dgraph.io/u/Rohan_Surana)\
**Replies:** 1\
**Last updated:** [April 2, 2024, 5:41pm UTC](https://discuss.dgraph.io/t/whats-the-best-way-to-support-transactions-with-graphql-using-shurcools-golang-client/19256 "2024-04-02T17:41:51Z")

</div>

I moved from DQL to GraphQL. Based on what I read so far, any dgraph client is grpc support transactions. I am using shurcool’s graphql golang client. It does not support transactions directly. How do I support transact…

---

## [Cron Scheduler](https://discuss.dgraph.io/t/cron-scheduler/19233)

<div class="topic-metadata">

**Author:** [@Deepak\_Kumar\_Gupta](https://discuss.dgraph.io/u/Deepak_Kumar_Gupta)\
**Replies:** 0\
**Last updated:** [March 15, 2024, 5:42am UTC](https://discuss.dgraph.io/t/cron-scheduler/19233 "2024-03-15T05:42:35Z")

</div>

How can i add Cron or Scheduler for update DB at a timestamp

---

## [DQL from GraphQL](https://discuss.dgraph.io/t/dql-from-graphql/19193)

<div class="topic-metadata">

**Author:** [@Ignacio\_Horrillo](https://discuss.dgraph.io/u/Ignacio_Horrillo)\
**Replies:** 2\
**Last updated:** [February 26, 2024, 5:41pm UTC](https://discuss.dgraph.io/t/dql-from-graphql/19193 "2024-02-26T17:41:28Z")

</div>

Hello, How can we get the DQL sentence from a GraphQL sentence?

---

## [How to use fuzzy search with graphql API?](https://discuss.dgraph.io/t/how-to-use-fuzzy-search-with-graphql-api/14582)

<div class="topic-metadata">

**Author:** [@Vasile\_E](https://discuss.dgraph.io/u/Vasile_E)\
**Replies:** 5\
**Last updated:** [January 29, 2024, 2:22am UTC](https://discuss.dgraph.io/t/how-to-use-fuzzy-search-with-graphql-api/14582 "2024-01-29T02:22:34Z")

</div>

I want to use fuzzy search with tolerance parameter. Is there a way to achieve that with graphql API? { directors(func: match(name@en, Stephen, 8)) { name@en } }

---

## [RFC: Allow language Tag support in GraphQL](https://discuss.dgraph.io/t/rfc-allow-language-tag-support-in-graphql/13027)

<div class="topic-metadata">

**Author:** [@JatinDevDG](https://discuss.dgraph.io/u/JatinDevDG)\
**Replies:** 13\
**Last updated:** [January 18, 2024, 3:38pm UTC](https://discuss.dgraph.io/t/rfc-allow-language-tag-support-in-graphql/13027 "2024-01-18T15:38:32Z")

</div>

Summary We have language tag support in dgraph where we can mutate or query a single field in multiple languages. Many users wants this functionality to be added in graphql. And also users which are having data in dgraph…

---

## [Live Loader has issues with dgraph types when loading an export file](https://discuss.dgraph.io/t/live-loader-has-issues-with-dgraph-types-when-loading-an-export-file/19157)

<div class="topic-metadata">

**Author:** [@jackl](https://discuss.dgraph.io/u/jackl)\
**Replies:** 0\
**Last updated:** [January 11, 2024, 10:21pm UTC](https://discuss.dgraph.io/t/live-loader-has-issues-with-dgraph-types-when-loading-an-export-file/19157 "2024-01-11T22:21:46Z")

</div>

I have a Dgraph Cloud instance, and the backend is only accessed through the GraphQL layer. I exported my cloud data (~600MB) through the cloud export tool. I’m trying to import the data into a local instance running on…

---

## [How to work with Nested Lambda in Dgraph?](https://discuss.dgraph.io/t/how-to-work-with-nested-lambda-in-dgraph/19136)

<div class="topic-metadata">

**Author:** [@Dywane\_Saludar](https://discuss.dgraph.io/u/Dywane_Saludar)\
**Replies:** 0\
**Last updated:** [December 21, 2023, 1:46am UTC](https://discuss.dgraph.io/t/how-to-work-with-nested-lambda-in-dgraph/19136 "2023-12-21T01:46:02Z")

</div>

I’m having a problem of using the resolver for nested Lambda in Dgraph. The implementation is working with the Apollo but for some reason when I tried it with Dgraph it doesn’t work. The context is, I have to create cust…

---

## [Why does the search function on the Dgraph document webpage disappear?](https://discuss.dgraph.io/t/why-does-the-search-function-on-the-dgraph-document-webpage-disappear/19077)

<div class="topic-metadata">

**Author:** [@hedaihua](https://discuss.dgraph.io/u/hedaihua)\
**Replies:** 0\
**Last updated:** [November 24, 2023, 11:40am UTC](https://discuss.dgraph.io/t/why-does-the-search-function-on-the-dgraph-document-webpage-disappear/19077 "2023-11-24T11:40:07Z")

</div>

Why does the search function on the Dgraph document webpage disappear?

---

## [What would be the best option to not use @id in interfaces?](https://discuss.dgraph.io/t/what-would-be-the-best-option-to-not-use-id-in-interfaces/19063)

<div class="topic-metadata">

**Author:** [@Beto](https://discuss.dgraph.io/u/Beto)\
**Replies:** 1\
**Last updated:** [November 18, 2023, 8:01pm UTC](https://discuss.dgraph.io/t/what-would-be-the-best-option-to-not-use-id-in-interfaces/19063 "2023-11-18T20:01:10Z")

</div>

Deprecated: “@id argument for get query on interface is being deprecated, it will be removed in v21.11.0, please update your query to not use that argument” interface Person { id: ID! popcode: String! @id @search(by…

---

## [In a DQL statement, how to pass the UID as a variable within the subquery block below](https://discuss.dgraph.io/t/in-a-dql-statement-how-to-pass-the-uid-as-a-variable-within-the-subquery-block-below/19022)

<div class="topic-metadata">

**Author:** [@douwenqing](https://discuss.dgraph.io/u/douwenqing)\
**Replies:** 2\
**Last updated:** [November 7, 2023, 6:02am UTC](https://discuss.dgraph.io/t/in-a-dql-statement-how-to-pass-the-uid-as-a-variable-within-the-subquery-block-below/19022 "2023-11-07T06:02:39Z")

</div>

In the given Dgraph data model type LearningStage { learning\_stage\_name: String! } type Grade { grade\_name: String! belonged\_\_learning\_stage: LearningStage! @revese contained\_subject: \[Subject!\] } t…

---

## [Can we use UID's obtained from /assign in GraphQL?](https://discuss.dgraph.io/t/can-we-use-uids-obtained-from-assign-in-graphql/18989)

<div class="topic-metadata">

**Author:** [@tariqkb](https://discuss.dgraph.io/u/tariqkb)\
**Replies:** 3\
**Last updated:** [October 18, 2023, 4:39am UTC](https://discuss.dgraph.io/t/can-we-use-uids-obtained-from-assign-in-graphql/18989 "2023-10-18T04:39:56Z")

</div>

I’m unable to use the ID’s retrieved from calling the assign mutation at the /admin endpoint in a graphql mutation. Add mutations don’t have a field for ID Update mutations give me the error: input: updateTest couldn't…

[Next page](https://discuss.dgraph.io/c/user/graphql/28.md?page=1)
