Skip to content

Add message level when using custom warning handler #553

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

Merged
merged 1 commit into from
Oct 13, 2019

Conversation

mcg-web
Copy link
Collaborator

@mcg-web mcg-web commented Oct 10, 2019

I need to make silent error_trigger but since it was already refused here I'm going to implement my own handler make it silent. This will fix the issue when using isTypeOf the first entry is null because of the warnOnce that trigger error not silently. Thanks to @murtukov while trying to write some documentation on isTypeOf...

@murtukov
Copy link
Contributor

murtukov commented Oct 10, 2019

I can confirm this. When I try to return a list of interfaces and use isTypeOf on each implementing type (instead of single resolveType) the first result in the returned collection is always null.

But adding \GraphQL\Error\Warning::suppress(); to the index.php of my Symfony project seems to fix this problem and I get all results as expected.

@vladar
Copy link
Member

vladar commented Oct 13, 2019

This will fix the issue when using isTypeOf the first entry is null because of the warnOnce that trigger error not silently

Why does it return null? I guess Symfony has a custom error handler that throws an exception when there is a warning?

Anyways, the change seems reasonable. Thanks!

@vladar vladar merged commit c11f95e into webonyx:master Oct 13, 2019
@mcg-web mcg-web deleted the add_message_level branch October 14, 2019 05:04
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.

3 participants