Skip to content

Enable Flow typings on errors tests + Fix typing for Error constructor#1582

Merged
IvanGoncharov merged 1 commit into
graphql:masterfrom
IvanGoncharov:node11Tests
Nov 21, 2018
Merged

Enable Flow typings on errors tests + Fix typing for Error constructor#1582
IvanGoncharov merged 1 commit into
graphql:masterfrom
IvanGoncharov:node11Tests

Conversation

@IvanGoncharov

Copy link
Copy Markdown
Member

No description provided.

Comment thread src/error/GraphQLError.js
constructor(
message: string,
nodes?: $ReadOnlyArray<ASTNode> | ASTNode | void,
nodes?: $ReadOnlyArray<ASTNode> | ASTNode | void | null,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All other arguments support null so there is no reason why nodes accepts undefined but not the null.

@IvanGoncharov IvanGoncharov merged commit f0ae3f4 into graphql:master Nov 21, 2018
yaacovCR added a commit to yaacovCR/graphql-js that referenced this pull request Jun 1, 2026
This test originally used a plain object without a stack. PR graphql#1582 changed it to new Error('original') while enabling Flow typing, which meant the test no longer exercised the no-stack fallback path.

This PR deletes the generated stack before constructing GraphQLError so the test can synthetically cover the intended branch while still passing type check.
yaacovCR added a commit that referenced this pull request Jun 1, 2026
This test originally used a plain object without a stack. PR #1582 changed it to new Error('original') while enabling Flow typing, which meant the test no longer exercised the no-stack fallback path.

This PR deletes the generated stack before constructing GraphQLError so the test can synthetically cover the intended branch while still passing type check.
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.

2 participants