Skip to content

Update to flow v0.38.0#671

Merged
robzhu merged 1 commit intographql:masterfrom
gabelevi:flow
Jan 18, 2017
Merged

Update to flow v0.38.0#671
robzhu merged 1 commit intographql:masterfrom
gabelevi:flow

Conversation

@gabelevi
Copy link
Copy Markdown
Contributor

I noticed some errors when running Flow v0.38.0 against a repo that used graphql-js. It looks like these two files were using [string], which is a tuple with a single string element, when they meant string[], which is an array of strings.

Flow v0.38.0 is stricter about tuples, so this no longer typechecked.

node_modules/graphql/validation/rules/ArgumentsOfCorrectType.js.flow:48
 48:               errors
                   ^^^^^^ array type. Only tuples and array literals with known elements can flow to
 22:   verboseErrors?: [string]
                       ^^^^^^^^ tuple type

node_modules/graphql/validation/rules/DefaultValuesOfCorrectType.js.flow:66
 66:               errors
                   ^^^^^^ array type. Only tuples and array literals with known elements can flow to
 33:   verboseErrors?: [string]
                       ^^^^^^^^ tuple type

server/fb-transforms/babel-relay-plugin/node_modules/graphql/validation/rules/ArgumentsOfCorrectType.js.flow:48
 48:               errors
                   ^^^^^^ array type. Only tuples and array literals with known elements can flow to
 22:   verboseErrors?: [string]
                       ^^^^^^^^ tuple type

server/fb-transforms/babel-relay-plugin/node_modules/graphql/validation/rules/DefaultValuesOfCorrectType.js.flow:66
 66:               errors
                   ^^^^^^ array type. Only tuples and array literals with known elements can flow to
 33:   verboseErrors?: [string]
                       ^^^^^^^^ tuple type

@gabelevi
Copy link
Copy Markdown
Contributor Author

It would be great if this change could be published as soon as possible. Anyone using Flow >v0.38.0 with graphql-js will get those 4 errors.

As for yarn, I did the following

yarn install --pure-lockfile # avoid messing with yarn.lock more than necessary
yarn add --dev [email protected]
./node_modules/.bin/flow check # no errors

@gabelevi
Copy link
Copy Markdown
Contributor Author

If this is merged then #670 is no longer necessary

@robzhu
Copy link
Copy Markdown
Contributor

robzhu commented Jan 18, 2017

Thanks!

@robzhu robzhu merged commit 9215a89 into graphql:master Jan 18, 2017
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