Skip to content

Conversation

@leebyron
Copy link
Contributor

@leebyron leebyron commented Dec 12, 2017

Semi-breaking: Those using flow should (but are not required) to change from new GraphQLList(t) and new GraphQLNonNull(t) to GraphQLList(t) and GraphQLNonNull(t)

Because class constructors are contravariant since flow/js lacks a "finally" keyword, we need to use functions to represent covariance in GraphQLList and GraphQLNonNull.

By having wrapping types be covariant, we can enable more checks and have more accurate predicates for refining types in GraphQL utilities.

**Semi-breaking: Those using flow should change from `new GraphQLList(t)` and `new GraphQLNonNull(t)` to `GraphQLList(t)` and `GraphQLNonNull(t)`**

Because class constructors are contravariant since flow/js lacks a "finally" keyword, we need to use functions to represent covariance in GraphQLList and GraphQLNonNull.

By having wrapping types be covariant, we can enable more checks and have more accurate predicates for refining types in GraphQL utilities.
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.

3 participants