-
-
Notifications
You must be signed in to change notification settings - Fork 895
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(graphql): link relations requires the property #4931
Conversation
webda2l
commented
Sep 8, 2022
Q | A |
---|---|
Branch? | 2.7 |
Tickets | #4613 (comment) & #4613 (comment) |
License | MIT |
Doc PR | api-platform/docs#... |
- Add tests
Nice work! |
It just need a few adaptions to work for current state of code |
@develth This PR needs Behat tests. I also need to understand what it does exactly. If you would you can create another PR with them. Also it should target 3.0, not 2.7. |
Same for me :) |
Maybe @webda2l could add some context about why it fixes it. |
Query like
With code like
is broken on 2.7/3.0. Due to the fact that links on a same entity (PropertyValue) but on a different property (materials & bodyParts) are not differentiated in the new codebase. And so, depends on the order of the gql "materials then bodyParts" or "bodyParts then materials", the results of both of them will always be the latest.
This PR works but yes, a core dev could do a better fix with full understanding of the codebase I think. |
@webda2l do you update this PR or should i create a new? |
@alanpoulain got it reproduced and fix with this commit in my PR-draft (#5169) It Happens as soon a Entity has an OneToMany Relation to an Item, that i s already realted on the current Entity: GraphQL Query: By updated |
@develth Nice, thanks! You should use (or create) another test resource, not the |
Will do it and mention you on the other PR |
Superseded by #5169. |