dgraph-io / dgraph

The high-performance database for modern applications
https://dgraph.io
Other
20.31k stars 1.49k forks source link

[BUG]: @id field in GraphQL is not editable #8608

Closed liuuuk311 closed 1 month ago

liuuuk311 commented 1 year ago

What version of Dgraph are you using?

latest docker image.

Dgraph version   : v22.0.2
Dgraph codename  : dgraph
Dgraph SHA-256   : 2d20d50783c67594f3a5cc65aebf13b8807ffc35ec68e0f7f4abb2bc0c59eb2e
Commit SHA-1     : 55697a4
Commit timestamp : 2022-12-16 23:03:35 +0000
Branch           : release/v22.0.2
Go version       : go1.18.5
jemalloc enabled : true

For Dgraph official documentation, visit https://dgraph.io/docs.
For discussions about Dgraph     , visit https://discuss.dgraph.io.
For fully-managed Dgraph Cloud   , visit https://dgraph.io/cloud.

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2022 Dgraph Labs, Inc.

Tell us a little more about your go-environment?

Not using go

Have you tried reproducing the issue with the latest release?

Yes

What is the hardware spec (RAM, CPU, OS)?

MacBook Pro 14 Inch, 2021. Memory 16GB, Chip Apple M1 Pro

What steps will reproduce the bug?

Schema:

type User {
    phoneNumber: String! @id @search(by: [exact])
    firebaseUID: String! @id 
    dateOfBirth: DateTime!
    profile: UserProfile @hasInverse(field: user)
}

type UserProfile {
    username: String @id 
    fullname: String!
    bio: String
    imageUrl: String
    user: User!
}

Create the schema using localhost:8080/admin/schema.

Output:

{
    "errors": [
        {
            "message": "resolving updateGQLSchema failed because input:9: Type UserProfile; Field username: with @id directive must be of type String!, Int! or Int64!, not String\n (Locations: [{Line: 3, Column: 4}])",
            "extensions": {
                "code": "Error"
            }
        }
    ]
}

Expected behavior and actual result.

I was expecting to be able to create a type the the @id directive with support for nullable and editable fields. This should be available from version 21.07 and I'm using version 22.0.2. Maybe I'm doing something wrong.

Additional information

Related PR for this feature Related RFC for this feature Other discussion about this feature

liuuuk311 commented 1 year ago

@JatinDev543 any thoughts?

github-actions[bot] commented 1 month ago

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.