Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A type can specify the same field multiple times #3924

Closed
danielmai opened this issue Sep 5, 2019 · 0 comments · Fixed by #3925
Closed

A type can specify the same field multiple times #3924

danielmai opened this issue Sep 5, 2019 · 0 comments · Fixed by #3925
Assignees
Labels
area/querylang Issues related to the query language specification and implementation. area/types Issues related to the type system. kind/enhancement Something could be better.

Comments

@danielmai
Copy link
Contributor

What version of Dgraph are you using?

v1.1.0

Have you tried reproducing the issue with the latest release?

Yes

Steps to reproduce the issue (command/config used to run Dgraph).

  1. Run Dgraph

  2. Update the schema with the following type:

    type Person {
      name: string
      name: string
    }
    
  3. The schema update is successful and the type contains two fields named name.

    schema(type: Person) {}
    
    {
      "data": {
        "types": [
          {
            "fields": [
              {
                "name": "name",
                "type": "string"
              },
              {
                "name": "name",
                "type": "string"
              }
            ],
            "name": "Person"
          }
        ]
      }
    }
    

Expected behavior and actual result.

This type shouldn't be valid. A way to avoid this would be for the schema update to fail with an error when there are duplicate field names.

@danielmai danielmai added kind/enhancement Something could be better. area/querylang Issues related to the query language specification and implementation. area/types Issues related to the type system. labels Sep 5, 2019
@martinmr martinmr self-assigned this Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/querylang Issues related to the query language specification and implementation. area/types Issues related to the type system. kind/enhancement Something could be better.
Development

Successfully merging a pull request may close this issue.

2 participants