Skip to content

Conversation

@vvakame
Copy link
Collaborator

@vvakame vvakame commented Nov 19, 2018

https://facebook.github.io/graphql/draft/#sec-Objects

3.6 Objects
Type Validation
The field must have a unique name within that Object type; no two fields may share the same name.

Object Extensions
Type Validation
The fields of an Object type extension must have unique names; no two fields may share the same name.
Any fields of an Object type extension must not be already defined on the original Object type.


  type Query {
    hello: String
    hello: String
  }

error on graphql-js!
https://runkit.com/vvakame/5bf29d85574142001208b7d5


  type Query {
    hello: String
  }
  extend type Query {
    hello: String
  }

🤔 ❓
https://runkit.com/vvakame/5bf29df977f07a001281a18a


  type Query {
    hello: String
  }
  extend type Query {
    bye: Int
    bye: Int
  }

🤔 ❓ ❓
https://runkit.com/vvakame/5bf29db24a9ab200128a6c24

@vvakame vvakame requested a review from vektah November 19, 2018 11:30
@vvakame
Copy link
Collaborator Author

vvakame commented Nov 19, 2018

BTW, parser can't validate __foobar field now.

All fields defined within an Object type must not have a name which begins with "__" (two underscores), as this is used exclusively by GraphQL’s introspection system.

@vektah vektah force-pushed the feat-duplicate-check branch from 26bc144 to 9c02695 Compare November 25, 2018 23:31
@vektah vektah merged commit 334b0b2 into master Nov 25, 2018
@vektah vektah deleted the feat-duplicate-check branch November 25, 2018 23:32
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 90.995% when pulling 9c02695 on feat-duplicate-check into c336811 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants