Skip to content

Feature Request - GraphQL - Composite (compound) ID fields - unique / primary #8176

Closed
@jdgamble555

Description

@jdgamble555

https://discuss.dgraph.io/t/composite-id-fields/13337
https://discuss.dgraph.io/t/support-multiple-unique-fields-in-dgraph-graphql/8512/15

There are 1000 links in the DGraph forum for this, but basically:

type Bar @unique(user, date) {
  user: String!
  date: String!
}

We need this SQL equivalent: ALTER TABLE `Bar` ADD UNIQUE `unique_index`(`user`, `date`);

We need unique values based on two fields at the same time. There are 1000 use cases for this, but it is a necessity in any mature database. There are only work arounds in CERTAIN situations.

J


UPDATE: This issue is already covered in this issue. Just refer there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/graphqlIssues related to GraphQL support on Dgraph.communityIssue or PR created by the community.kind/featureSomething completely new we should consider.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions