-
Notifications
You must be signed in to change notification settings - Fork 99
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
Unhelpful error message when a query is defined twice #322
Comments
Interesting! For instance by duplicating this test ( graphqlite/tests/Integration/EndToEndTest.php Lines 1533 to 1547 in c617743
|
Yep, will give it a go :) |
I've tried to recreate the issue here: lexmes@49274e3 But the error message there is correct. Can you think of any Circumstance under which the |
@lexmes I'm assuming you confirmed that assertions are enabled in the environment in which you tested? That's a PHP config setting. I not really sure that we should be using assert in this particular case. |
I have seen some errors from asserts in development, it's usually when queries/fields/names are duplicated |
Assert can be problematic b/c it doesn't provide any context to the assertion. And you took the time to write it. Just take a few seconds more to throw an exception with an intelligible message that helps the developer, or yourself later on. |
@lexmes can you create a PR for this please. |
Lets assume we have to following setup:
Right now the error message that i get is:
assert($firstDuplicate instanceof FieldDefinition)
. Thats not very helpful. I would suggest something along the lines ofcannot redeclare query "allPosts" in controller "<FQDN>\ControllerB" as it was already defined in <FQDN>\ControllerA
.I don't know if its my setup that is causing this error. But even then its not very helpful.
The error is generated in
AggregateControllerQueryProvider.php:98
.The text was updated successfully, but these errors were encountered: