Skip to content

Conversation

dittos
Copy link
Contributor

@dittos dittos commented Jul 8, 2015

Registering two different types with the same name was silently passing.

@devknoll
Copy link

devknoll commented Jul 8, 2015

I think it would be a little more natural if an error was thrown when GraphQLSchema was constructed, not later when getTypeMap is called

@schrockn-zz
Copy link
Contributor

Agree with @devknoll .ctor seems a bit more deterministic/natural

@dittos dittos force-pushed the prevent-type-name-collision branch from 941fa39 to c2a73b2 Compare July 9, 2015 14:07
@dittos
Copy link
Contributor Author

dittos commented Jul 9, 2015

Changed to throw in the constructor, by building type map eagerly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"does not allow more than one type of the same name"

@dittos dittos force-pushed the prevent-type-name-collision branch from c2a73b2 to 1374b2e Compare July 14, 2015 12:03
@dittos dittos closed this Aug 8, 2015
leebyron added a commit that referenced this pull request Aug 13, 2015
A freshening up of the PR #35 (thanks @dittos)

This enforces that a schema consists of a list of uniquely named types, as per the spec.
@leebyron
Copy link
Contributor

Thanks for raising this, @dittos. I pulled in this PR in d3188d3 and added a wider suite of tests.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants