-
-
Notifications
You must be signed in to change notification settings - Fork 954
fix(graphql): use depth for nested resource class operation #5314
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
Conversation
|
Hello, thanks for this PR! |
843b723 to
b726568
Compare
Sorry - this still needs some work, as I'm currently not able to reproduce the problem in an isolated test fase |
b726568 to
0398a1b
Compare
|
Let's see whether the CI triggers the same problem I could reproduce locally now. Also, I've found how my previous version of this reproducer differs from this one: by reordering the list of graphqloperations on the TreeDummy, I was able to fix the bug. Having QueryCollection first and then Query, no bug is thrown. This also resolves the problem in my own application. But that looks pretty strange to me. Why should the order of these operations influence how a field is resolved? |
0398a1b to
2c4c6a5
Compare
|
Hello @NicoHaase, I've made the fix I think is appropriate. What do you think of it? |
will create a diff patch & test it - thx! |
|
Your fix was successful for me @alanpoulain ! |
|
I haven't checked this fix yet, but when the test is no longer failing, I would assume it works :) But what makes me curious is why ordering the operations makes a difference. This is not addressed in this fix |
|
It doesn't make a difference anymore since the nested operation will now always be selected depending on the type (collection or not). You can better understand it here: core/src/GraphQl/Type/TypeBuilder.php Lines 51 to 54 in 902b135
The first operation on the resource will be used to determine the resource GraphQL type. |
…form#5314) * test: add reproducer for bug 5310 * fix(graphql): use depth for nested resource class operation Co-authored-by: Alan Poulain <[email protected]>
* chore(deprecation): Only use ValueResolverInterface if it exists * chore(deprecation): fix CS * chore(deprecation): Add new CompatibleValueResolverInterface * fix(graphql): use depth for nested resource class operation (#5314) * test: add reproducer for bug 5310 * fix(graphql): use depth for nested resource class operation Co-authored-by: Alan Poulain <[email protected]> * ci: test against lowest dependencies (#5329) Co-authored-by: Nico Haase <[email protected]> Co-authored-by: Alan Poulain <[email protected]>
Reproducer for the bug reported in #5310