#8409·dgraph

[FEATURE]: DQL Not Null Constraint (Existential)

Author: jdgamble555Created Nov 2, 2022Updated Aug 9, 2026
Labelskind/featurecommunityarea/dql-graphql-interopStale

Have you tried Dgraph before this proposal? and did not find anything similar?

No response

What you wanted to do.

Enforce that a value exists in a node in DQL.

Perhaps on the DQL schema:

type Person {
  friend @notnull
  ...
}

I should not be able to alter the schema where non null values exist.

What you actually did.

You can do this now in GraphQL with the ! in front of the type. See here.

We need to be able to do this in DQL.

Why wasn't it great, with examples.

You can add data in DQL, ignoring the GraphQL constraint, causing data integrity issues. It should be IMPOSSIBLE to have null data if this constraint is actie.

Additional information.

How neo4j handles it. How sql handles it.