[GraphQL] Add a clearer error message when TwigBundle is disable but graphql clients aren't#5064
Merged
Conversation
c23a046 to
a1e5e2f
Compare
Member
|
nice patch, I think that the phpstan issue is related though |
Contributor
Author
Yes it's totally related but I think it's because of phpsant.neon.dist. Inside we specify to phpstan to use the container of the test env cache and in test the parameter Do you have any idea on how to fix that without adding a |
Member
|
In this specific case, I think a |
0d46cd6 to
fd2444a
Compare
alanpoulain
reviewed
Oct 21, 2022
|
|
||
| $loader->load('graphql.xml'); | ||
|
|
||
| // @phpstan-ignore-next-line We ignore the next line because we specify to phpstan to use the container of the test env cache and in test the parameter kernel.bundles always contains the key TwigBundle |
Member
There was a problem hiding this comment.
Suggested change
| // @phpstan-ignore-next-line We ignore the next line because we specify to phpstan to use the container of the test env cache and in test the parameter kernel.bundles always contains the key TwigBundle | |
| // @phpstan-ignore-next-line because PHPStan uses the container of the test env cache and in test the parameter kernel.bundles always contains the key TwigBundle |
fd2444a to
7751f0d
Compare
alanpoulain
approved these changes
Oct 21, 2022
8967c5c to
30f3d5f
Compare
…ut graphQL clients are enabled
30f3d5f to
04db4fc
Compare
Member
|
Thanks @ArnoudThibaut. |
soyuka
added a commit
that referenced
this pull request
Nov 4, 2022
* fix: update yaml extractor test file coding standard (#5068) * fix(graphql): add clearer error message when TwigBundle is disabled but graphQL clients are enabled (#5064) * fix(metadata): add class key in payload argument resolver (#5067) * fix: add class key in payload argument resolver * add null if everything else goes wrong * fix: upgrade command remove ApiSubresource attribute (#5049) Fixes #5038 * fix(doctrine): use abitrary index instead of value (#5079) * fix: uri template should respect rfc 6570 (#5080) * fix: remove @internal annotation for Operations (#5089) See #5084 * fix(metadata): define a name on a single operation (#5090) fixes #5082 * fix(metadata): deprecate when user decorates in legacy mode (#5091) fixes #5078 * fix(graphql): use right nested operation (#5102) * Revert "fix(graphql): use right nested operation (#5102)" (#5111) This reverts commit 44337dd. * fix(graphql): always allow to query nested resources (#5112) * fix(graphql): always allow to query nested resources * review Co-authored-by: Alan Poulain <[email protected]> * chore: php-cs-fixer update * fix: only alias if exists for opcache preload Fixes api-platform/api-platform#2284 (#5110) Co-authored-by: Liviu Mirea <[email protected]> * chore: php-cs-fixer update (#5118) * chore: php-cs-fixer update * chore: php-cs-fixer update * fix(metadata): upgrade script keep operation name (#5109) origin: #5105 Co-authored-by: WilliamPeralta <[email protected]> * chore: v2.7.3 changelog * chore: v3.0.3 changelog Co-authored-by: helyakin <[email protected]> Co-authored-by: ArnoudThibaut <[email protected]> Co-authored-by: davy-beauzil <[email protected]> Co-authored-by: Baptiste Leduc <[email protected]> Co-authored-by: Xavier Laviron <[email protected]> Co-authored-by: Alan Poulain <[email protected]> Co-authored-by: Liviu Cristian Mirea-Ghiban <[email protected]> Co-authored-by: Liviu Mirea <[email protected]> Co-authored-by: WilliamPeralta <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of having an error thrown by the CheckExceptionOnInvalidReferenceBehaviorPass when Twig is not installed or enabled we send a clearer exception and force the user to either disable the GraphQL clients or enable Twig.
If the clients are not enabled we remove the definition as they can't be instantiate and we pass null to the GraphQl action.
Maybe we should not trowing an exception and instead disable silently the the clients if Twig is not enabled but I find better to add an explicit error message.