Skip to content

Flow type errors #1

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

Open
wants to merge 2 commits into
base: wrapmethods
Choose a base branch
from
Open

Flow type errors #1

wants to merge 2 commits into from

Conversation

mohawk2
Copy link
Owner

@mohawk2 mohawk2 commented Oct 4, 2017

@kadikraman As discussed, here are the changes that are additional to the ones in graphql#1054 - that PR also has the error messages, repro-ed here:

The declaration of the wrapNonNull method:

wrapNonNull(): GraphQLNonNull<*> { ... }

The strange type failure. It is particularly strange to me because the same syntax and type declarations work fine on the wrapList method. This is an excerpt of the error:

       Property `type` is incompatible:
        111:       type: GraphQLString.wrapNonNull(),
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ GraphQLNonNull. This type is incompatible with
        673:   type: GraphQLOutputType;
                     ^^^^^^^^^^^^^^^^^ union: GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType | type application of class `GraphQLList` | type application of class `GraphQLNonNull`. See: src/type/definition.js:673

It seems to be losing the "type application" on GraphQLNonNull. It did this even when I adjusted the return type of wrapNonNull from GraphQLNonNull<*> to GraphQLNonNull<GraphQLScalarType>. Any insight into why would be greatly appreciated!

@kadikraman
Copy link

Hey! No idea I'm afraid. Doesn't look obvious to me. Hopefully the core contributors can help 😊

@mohawk2 mohawk2 force-pushed the wrapmethods branch 3 times, most recently from 635fdcc to 0740bef Compare December 25, 2017 22:28
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.

2 participants