Skip to content
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

locatedError: correct definition to pass Flow 0.68 check #1292

Merged
merged 1 commit into from
Apr 5, 2018

Conversation

IvanGoncharov
Copy link
Member

Not sure how to fix other $FlowFixMe introduced in #1291 but this was a low hanging fruit.

@leebyron
Copy link
Contributor

Seems weird. GraphQLError should be a subset of Error, so not required to explicitly declare. I'll take a look

@IvanGoncharov
Copy link
Member Author

Seems weird. GraphQLError should be a subset of Error, so not required to explicitly declare. I'll take a look

@leebyron It's happening because of this change in Flow:

Likely to cause new Flow errors:

Previously, Flow would allow you to write if (foo.unknownProp) { ... }.

Now Flow disallows testing unknown properties in conditionals. If foo is a
union type like { x: string } | { y: number }, x and y are known
properties and z would be an unknown property

So after this change, you can't test if an instance of Error has path property.
But the same check works for instances of GraphQLError.

@leebyron
Copy link
Contributor

leebyron commented Apr 5, 2018

Ahhh, yes that makes sense. Thanks for the explanation!

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.

None yet

3 participants