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

fix: specify type better for context arg in defaultErrorFormatter #690

Merged
merged 2 commits into from Dec 22, 2021

Conversation

capaj
Copy link
Contributor

@capaj capaj commented Dec 21, 2021

When context is null for example, it crashes with a type error

TypeError: Cannot read property 'reply' of null
    at AsyncFunction.defaultErrorFormatter (/home/capaj/work-repos/authier-repos/authier/node_modules/mercurius/lib/errors.js:67:19)

When context is null for example, it crashes with a type error
```
TypeError: Cannot read property 'reply' of null
    at AsyncFunction.defaultErrorFormatter (/home/capaj/work-repos/authier-repos/authier/node_modules/mercurius/lib/errors.js:67:19)
```
@capaj capaj changed the title fix: specify type better for context fix: specify type better for context in defaultErrorFormatter Dec 21, 2021
@capaj capaj changed the title fix: specify type better for context in defaultErrorFormatter fix: specify type better for context arg in defaultErrorFormatter Dec 21, 2021
Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

Thanks! Could you add an assertion for this in our types tests.

Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 0ace215 into mercurius-js:master Dec 22, 2021
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.

None yet

2 participants