# \#schema

**URL:** https://discuss.dgraph.io/tag/schema/54.md

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

---

## [Concept: mark task as seen, mark task as completed](https://discuss.dgraph.io/t/concept-mark-task-as-seen-mark-task-as-completed/19236)

<div class="topic-metadata">

**Author:** [@SunSparc](https://discuss.dgraph.io/u/SunSparc)\
**Replies:** 2\
**Last updated:** [March 17, 2024, 2:40pm UTC](https://discuss.dgraph.io/t/concept-mark-task-as-seen-mark-task-as-completed/19236 "2024-03-17T14:40:04Z")

</div>

I have users that are grouped together in a team to work on a project together. I am creating a schema to track when each team member on the projects has: seen a task completed the task. This is the schema that I hav…

---

## [Schema review: new to DGraphj](https://discuss.dgraph.io/t/schema-review-new-to-dgraphj/19126)

<div class="topic-metadata">

**Author:** [@Rohan\_Surana](https://discuss.dgraph.io/u/Rohan_Surana)\
**Replies:** 7\
**Last updated:** [January 8, 2024, 8:28pm UTC](https://discuss.dgraph.io/t/schema-review-new-to-dgraphj/19126 "2024-01-08T20:28:50Z")

</div>

Hello All! I am first time using DGraph. I would love if anyone could review my schema. It’s a very basic use case where I have two types of nodes: Tag and Resource. I want to keep the edges unidirectional, as I would …

---

## [Add @default directive to v22 of dgraph](https://discuss.dgraph.io/t/add-default-directive-to-v22-of-dgraph/18221)

<div class="topic-metadata">

**Author:** [@mahdi78](https://discuss.dgraph.io/u/mahdi78)\
**Replies:** 4\
**Last updated:** [August 7, 2023, 3:31pm UTC](https://discuss.dgraph.io/t/add-default-directive-to-v22-of-dgraph/18221 "2023-08-07T15:31:26Z")

</div>

hi please add @default directive to v22 from v21.12 . this merge request in v21.12 added this feature. thanks.

---

## [Entering Schema in Ratel](https://discuss.dgraph.io/t/entering-schema-in-ratel/18243)

<div class="topic-metadata">

**Author:** [@mburbidg](https://discuss.dgraph.io/u/mburbidg)\
**Replies:** 3\
**Last updated:** [February 4, 2023, 3:53am UTC](https://discuss.dgraph.io/t/entering-schema-in-ratel/18243 "2023-02-04T03:53:27Z")

</div>

The documentation claims that you can add the following types directly in the Schema tab in Ratel. I can’t figure out how to do that. Any help? type Person { id: ID! xid: String! @id name: String! age: Int @sear…

---

## [@generate causes server panic if only the update mutation for a type is set to true](https://discuss.dgraph.io/t/generate-causes-server-panic-if-only-the-update-mutation-for-a-type-is-set-to-true/18222)

<div class="topic-metadata">

**Author:** [@Poolshark](https://discuss.dgraph.io/u/Poolshark)\
**Replies:** 0\
**Last updated:** [February 1, 2023, 9:42am UTC](https://discuss.dgraph.io/t/generate-causes-server-panic-if-only-the-update-mutation-for-a-type-is-set-to-true/18222 "2023-02-01T09:42:27Z")

</div>

What version of Dgraph are you using? Dgraph Cloud v21.03.0-92-g0c9f60156 Tell us a little more about your go-environment? No response Have you tried reproducing the issue with the latest release? Yes What is the hard…

---

## [Best Practice when developing schemas GraphQL First or DQL First?](https://discuss.dgraph.io/t/best-practice-when-developing-schemas-graphql-first-or-dql-first/18172)

<div class="topic-metadata">

**Author:** [@koderguy](https://discuss.dgraph.io/u/koderguy)\
**Replies:** 4\
**Last updated:** [January 19, 2023, 4:00am UTC](https://discuss.dgraph.io/t/best-practice-when-developing-schemas-graphql-first-or-dql-first/18172 "2023-01-19T04:00:40Z")

</div>

Noobie here. I’d like to know when I’m designing my schema, whether it is better to design against GraphQL first or design it against DQL first then add the GraphQL schema. From the docs and my limited experience it se…

---

## [How versioning GraphQL Schema?](https://discuss.dgraph.io/t/how-versioning-graphql-schema/18187)

<div class="topic-metadata">

**Author:** [@TL2\_SM](https://discuss.dgraph.io/u/TL2_SM)\
**Replies:** 3\
**Last updated:** [January 19, 2023, 12:49am UTC](https://discuss.dgraph.io/t/how-versioning-graphql-schema/18187 "2023-01-19T00:49:36Z")

</div>

Newbie here, I’m using Dgraph Cloud API and want to know if exists any way to design a control-version for the schemas or a new form to perform How we set up version control of our schema on Slash on Dgraph Cloud.

---

## [Best way to handle Searchable Product Tags](https://discuss.dgraph.io/t/best-way-to-handle-searchable-product-tags/17617)

<div class="topic-metadata">

**Author:** [@thelovesmith](https://discuss.dgraph.io/u/thelovesmith)\
**Replies:** 14\
**Last updated:** [August 15, 2022, 2:44pm UTC](https://discuss.dgraph.io/t/best-way-to-handle-searchable-product-tags/17617 "2022-08-15T14:44:39Z")

</div>

Good afternoon, I have recently started working with DGraph and I am very pleased! I have recently come across an obstacle with building out my Schema. I am working with types that have a: tags: \[Tags!\]! property. I …

---

## [How to return "edges" count and whether "edge" between two nodes exists?](https://discuss.dgraph.io/t/how-to-return-edges-count-and-whether-edge-between-two-nodes-exists/16661)

<div class="topic-metadata">

**Author:** [@Admin\_16](https://discuss.dgraph.io/u/Admin_16)\
**Replies:** 4\
**Last updated:** [January 26, 2022, 4:39am UTC](https://discuss.dgraph.io/t/how-to-return-edges-count-and-whether-edge-between-two-nodes-exists/16661 "2022-01-26T04:39:16Z")

</div>

I’m working on a social network using a graph-db, I have just migrated from a different graph-db provider so I already have my own schema, except that it is a bit different. So far I’m having issues with retrieving the c…

---

## [DGraph Support for Enums](https://discuss.dgraph.io/t/dgraph-support-for-enums/16476)

<div class="topic-metadata">

**Author:** [@Tim\_Romanski](https://discuss.dgraph.io/u/Tim_Romanski)\
**Replies:** 8\
**Last updated:** [January 19, 2022, 12:12am UTC](https://discuss.dgraph.io/t/dgraph-support-for-enums/16476 "2022-01-19T00:12:58Z")

</div>

Hi! I’m working on a schema for my company, we have an entity which could be one of a set of types. An analogous example is cups, if we need to represent an inventory of cups and want to store their color which can only …

---

## [Strategy for partial text search](https://discuss.dgraph.io/t/strategy-for-partial-text-search/16569)

<div class="topic-metadata">

**Author:** [@jonas\_levin](https://discuss.dgraph.io/u/jonas_levin)\
**Replies:** 9\
**Last updated:** [January 18, 2022, 2:29am UTC](https://discuss.dgraph.io/t/strategy-for-partial-text-search/16569 "2022-01-18T02:29:35Z")

</div>

I have created a schema for a Profile and want to create efficant indexes for partial text search. My goal is to return relevant profiles through a search on the username, firstname, or lastname. For example with the qu…

---

## [Migrating Data with DQL after changing GraphQL Schema](https://discuss.dgraph.io/t/migrating-data-with-dql-after-changing-graphql-schema/16366)

<div class="topic-metadata">

**Author:** [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Replies:** 1\
**Last updated:** [December 19, 2021, 6:59am UTC](https://discuss.dgraph.io/t/migrating-data-with-dql-after-changing-graphql-schema/16366 "2021-12-19T06:59:57Z")

</div>

Lets say we made these changes to our schema (v21.12+): -type UserEmails { +type UserEmail { + id: ID! email: String @search verified: Boolean @search + owner: User @hasInverse(field: "linkedEmails") } type U…

---

## [@id directive and mutations](https://discuss.dgraph.io/t/id-directive-and-mutations/16079)

<div class="topic-metadata">

**Author:** [@ylvov](https://discuss.dgraph.io/u/ylvov)\
**Replies:** 2\
**Last updated:** [November 17, 2021, 3:40pm UTC](https://discuss.dgraph.io/t/id-directive-and-mutations/16079 "2021-11-17T15:40:25Z")

</div>

Hello, I am new with Dgraph. Now I am trying to make it a part of ETL process and import some data in Dgraph database. From the documentation I learnt that setting @id directive in my schema allows me to avoid duplicate…

---

## [GraphQL query does not respond when a list field is empty](https://discuss.dgraph.io/t/graphql-query-does-not-respond-when-a-list-field-is-empty/15865)

<div class="topic-metadata">

**Author:** [@itsjay](https://discuss.dgraph.io/u/itsjay)\
**Replies:** 5\
**Last updated:** [October 25, 2021, 9:17pm UTC](https://discuss.dgraph.io/t/graphql-query-does-not-respond-when-a-list-field-is-empty/15865 "2021-10-25T21:17:01Z")

</div>

When I have multiple list fields with the same type in GraphQL schema, and one of those is empty, the query just doesn’t respond As an example, if this is my schema: type TestQuestion { id: ID! name: String! answ…

---

## [Export schema](https://discuss.dgraph.io/t/export-schema/10089)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 6\
**Last updated:** [October 19, 2021, 10:55am UTC](https://discuss.dgraph.io/t/export-schema/10089 "2021-10-19T10:55:14Z")

</div>

Hi, Is it possible to export or import a scheme that was created with Ratel? Thanks, Or

---

## [Schema for ecommerce with multiple variants/attributes](https://discuss.dgraph.io/t/schema-for-ecommerce-with-multiple-variants-attributes/15808)

<div class="topic-metadata">

**Author:** [@panakour](https://discuss.dgraph.io/u/panakour)\
**Replies:** 2\
**Last updated:** [October 17, 2021, 5:41pm UTC](https://discuss.dgraph.io/t/schema-for-ecommerce-with-multiple-variants-attributes/15808 "2021-10-17T17:41:36Z")

</div>

What is the most appropriate way to design an eCommerce that has different variations/attributes depending on the product type. For example lets consider computeruniverse, gpu and macbook should have different fitters: …

---

## [updateGQLSchema returns Unexpected \\u003cInvalid\\u003e\\n](https://discuss.dgraph.io/t/updategqlschema-returns-unexpected-u003cinvalid-u003e-n/12825)

<div class="topic-metadata">

**Author:** [@SamSamit](https://discuss.dgraph.io/u/SamSamit)\
**Replies:** 9\
**Last updated:** [September 14, 2021, 8:58am UTC](https://discuss.dgraph.io/t/updategqlschema-returns-unexpected-u003cinvalid-u003e-n/12825 "2021-09-14T08:58:36Z")

</div>

Problems with posting schema Dgraph Version$ dgraph version Master Have you tried reproducing the issue with the latest release? Same problem with Master version and v20.11.1 Steps to reproduce the issue (command/co…

---

## [How to add reverse directive](https://discuss.dgraph.io/t/how-to-add-reverse-directive/15110)

<div class="topic-metadata">

**Author:** [@iamvibinvijay](https://discuss.dgraph.io/u/iamvibinvijay)\
**Replies:** 3\
**Last updated:** [August 12, 2021, 5:05am UTC](https://discuss.dgraph.io/t/how-to-add-reverse-directive/15110 "2021-08-12T05:05:00Z")

</div>

Hi All, Could you please help me in adding the reverse edge for the attributes userlist.userSkills and skills.belongsTo ? As of now, I’m using curl to load this schema and through the Ratel UI, I’m manually adding the …

---

## [Understanding the mapping between GraphQL and DQL Schema Definitions](https://discuss.dgraph.io/t/understanding-the-mapping-between-graphql-and-dql-schema-definitions/15132)

<div class="topic-metadata">

**Author:** [@bluesman](https://discuss.dgraph.io/u/bluesman)\
**Replies:** 3\
**Last updated:** [July 29, 2021, 10:06pm UTC](https://discuss.dgraph.io/t/understanding-the-mapping-between-graphql-and-dql-schema-definitions/15132 "2021-07-29T22:06:18Z")

</div>

I want to use DQL to be able to bulk load RDF triples into DGraph and then query the loaded data by name using both DQL and GraphQL. I understand that in order to be able to query using GraphQL, I must create a GraphQL …

---

## [Can I use multiple @id field in my Dgraph Type](https://discuss.dgraph.io/t/can-i-use-multiple-id-field-in-my-dgraph-type/13019)

<div class="topic-metadata">

**Author:** [@Md.Aminul\_Islam\_Sark](https://discuss.dgraph.io/u/Md.Aminul_Islam_Sark)\
**Replies:** 5\
**Last updated:** [July 7, 2021, 12:47pm UTC](https://discuss.dgraph.io/t/can-i-use-multiple-id-field-in-my-dgraph-type/13019 "2021-07-07T12:47:16Z")

</div>

Can I use multiple @id in a single type. my schema is like following type User@secret(field: "password") { uuid: String! @id @search(by:\[fulltext,term\]) email: String! @search(by:\[fulltext,term\]) } email fiel…

---

## [Partially typed schema](https://discuss.dgraph.io/t/partially-typed-schema/14591)

<div class="topic-metadata">

**Author:** [@igrekun](https://discuss.dgraph.io/u/igrekun)\
**Replies:** 5\
**Last updated:** [June 30, 2021, 11:12am UTC](https://discuss.dgraph.io/t/partially-typed-schema/14591 "2021-06-30T11:12:38Z")

</div>

I know in advance what structure I expect to receive for some parts of my data but one certain field can contain arbitrary JSON. I want to be able to return the original JSON by following the node and run some aggregate…

---

## [Auth on Schema, invalid "Alg"](https://discuss.dgraph.io/t/auth-on-schema-invalid-alg/14474)

<div class="topic-metadata">

**Author:** [@Marco\_Antonio](https://discuss.dgraph.io/u/Marco_Antonio)\
**Replies:** 9\
**Last updated:** [June 8, 2021, 7:34pm UTC](https://discuss.dgraph.io/t/auth-on-schema-invalid-alg/14474 "2021-06-08T19:34:33Z")

</div>

A simple User schema which expects a sub claim inside the token payload can be this one: type User @auth( query: { rule: """ query ($sub: String!){ queryUser(filter: {id: {eq: $su…

---

## [How to write @auth incase of user role claim in JWT has a array format](https://discuss.dgraph.io/t/how-to-write-auth-incase-of-user-role-claim-in-jwt-has-a-array-format/10104)

<div class="topic-metadata">

**Author:** [@sarankrishna](https://discuss.dgraph.io/u/sarankrishna)\
**Replies:** 12\
**Last updated:** [May 9, 2021, 2:56am UTC](https://discuss.dgraph.io/t/how-to-write-auth-incase-of-user-role-claim-in-jwt-has-a-array-format/10104 "2021-05-09T02:56:18Z")

</div>

Hi there, I have the following schema in dgraph type Todo { id: ID! text: String! @search(by: \[term\]) owner: String! } I wanted to implement Role-Based Access control (RBAC) using the JWT token. My sample…

---

## [How to design a data-version-controll DQL Schema](https://discuss.dgraph.io/t/how-to-design-a-data-version-controll-dql-schema/13099)

<div class="topic-metadata">

**Author:** [@buch-tgw](https://discuss.dgraph.io/u/buch-tgw)\
**Replies:** 1\
**Last updated:** [March 8, 2021, 5:17pm UTC](https://discuss.dgraph.io/t/how-to-design-a-data-version-controll-dql-schema/13099 "2021-03-08T17:17:04Z")

</div>

We are wondering how to design a DQL-Data-Schema, which is able to store versioned data. We must be able to each write a Query… which only returns the just the current values which returns the values of a specific Ver…

---

## [Applying GraphQL schema times out](https://discuss.dgraph.io/t/applying-graphql-schema-times-out/12705)

<div class="topic-metadata">

**Author:** [@machship-mm](https://discuss.dgraph.io/u/machship-mm)\
**Replies:** 6\
**Last updated:** [February 15, 2021, 2:06am UTC](https://discuss.dgraph.io/t/applying-graphql-schema-times-out/12705 "2021-02-15T02:06:04Z")

</div>

Report a GraphQL Bug What edition and version of Dgraph are you using? Edition: SlashGraphQL Dgraph (community edition/Dgraph Cloud) If you are using the community edition or enterprise edition of Dgraph, please …

---

## [Beeps are heard when importing scheme to v20.11.0](https://discuss.dgraph.io/t/beeps-are-heard-when-importing-scheme-to-v20-11-0/11979)

<div class="topic-metadata">

**Author:** [@mbn18](https://discuss.dgraph.io/u/mbn18)\
**Replies:** 8\
**Last updated:** [December 22, 2020, 6:26am UTC](https://discuss.dgraph.io/t/beeps-are-heard-when-importing-scheme-to-v20-11-0/11979 "2020-12-22T06:26:08Z")

</div>

Report a Dgraph Bug What version of Dgraph are you using? v.20.11.0 (docker) Have you tried reproducing the issue with the latest release? Yes What is the hardware spec (RAM, OS)? Dev station with Linux Fedora and 32GB…

---

## [Strange behaviour with interfaces (completly lost now)](https://discuss.dgraph.io/t/strange-behaviour-with-interfaces-completly-lost-now/11925)

<div class="topic-metadata">

**Author:** [@Florian](https://discuss.dgraph.io/u/Florian)\
**Replies:** 14\
**Last updated:** [December 17, 2020, 9:04am UTC](https://discuss.dgraph.io/t/strange-behaviour-with-interfaces-completly-lost-now/11925 "2020-12-17T09:04:21Z")

</div>

Hello, I tested out the new graphql technology in dgraph and I discovered, for me, a weird behaviour! When I declare this type type Test { Value: IInformation } interface IInformation { Tool: ToolTypes Ve…

---

## [Alter Schema using DQL in Python Client](https://discuss.dgraph.io/t/alter-schema-using-dql-in-python-client/11786)

<div class="topic-metadata">

**Author:** [@bbest-airmatrix](https://discuss.dgraph.io/u/bbest-airmatrix)\
**Replies:** 2\
**Last updated:** [December 7, 2020, 11:18am UTC](https://discuss.dgraph.io/t/alter-schema-using-dql-in-python-client/11786 "2020-12-07T11:18:48Z")

</div>

Hi there, When getting started with Dgraph I’ve been trying to use the Python client in order to alter the db schema. However when trying to use the DQL language shown in the docs the syntax is not accepted. It seems on…

---

## [List of existing languages per predicate](https://discuss.dgraph.io/t/list-of-existing-languages-per-predicate/11479)

<div class="topic-metadata">

**Author:** [@EnricoMi](https://discuss.dgraph.io/u/EnricoMi)\
**Replies:** 3\
**Last updated:** [November 17, 2020, 8:46am UTC](https://discuss.dgraph.io/t/list-of-existing-languages-per-predicate/11479 "2020-11-17T08:46:15Z")

</div>

When I query for the schema of my DGraph cluster with schema { }, I get: { "data": { "schema": \[ { "predicate": "http://www.w3.org/2000/01/rdf-schema#label", "type": "string", "index"…

---

## [How to model schema if we have many to many relationship between multiple models/entities?](https://discuss.dgraph.io/t/how-to-model-schema-if-we-have-many-to-many-relationship-between-multiple-models-entities/11290)

<div class="topic-metadata">

**Author:** [@sandeepkangude](https://discuss.dgraph.io/u/sandeepkangude)\
**Replies:** 15\
**Last updated:** [November 16, 2020, 8:05pm UTC](https://discuss.dgraph.io/t/how-to-model-schema-if-we-have-many-to-many-relationship-between-multiple-models-entities/11290 "2020-11-16T20:05:02Z")

</div>

I am designing a schema for my new application. During this process, I am stuck at one point. Here is my use case. I have three entities, User, Group, and Company. They are related to each other as many to many. For ex…

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