-
-
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
GraphQL: Nested Collections #6038
Conversation
506cb81
to
e5dc5b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs #6032 to run the CI
4a56dce
to
5adc973
Compare
Updated the PR. Still some jobs fail because of deprecations, but this is not related to the changes in this PR. Maybe it can be merged anyway |
In my opinion, since it's a collection it should follow the Relay specification and have |
5adc973
to
9539827
Compare
Works now. Can be controlled via |
Nice, maybe could you add one case with the pagination enabled too? |
9539827
to
c1eb026
Compare
Updated the tests. We now have nested collection with and without pagination enabled. |
abab343
to
899ac0a
Compare
899ac0a
to
c3a35cf
Compare
c3a35cf
to
da5a126
Compare
da5a126
to
8bdd7bc
Compare
I'll solve phpstan in another patch thanks @jotwea @alanpoulain ! It'd be nice to document this behavior now. |
* feat(graphql): support nested collections * null safe operator --------- Co-authored-by: josef.wagner <[email protected]> Co-authored-by: Antoine Bluchet <[email protected]>
We sometimes use JSON arrays to persist a collection of Value Objects which are not an entity. So this collection should be treated like a property of the parent entity. On the GraphQL queries fetching this collection was not an easy task. We had to create some special resolvers which try to fetch the ID of the parent entity out of the
$context
, load it and determine the collection from there.So I decided to spend this PR that utilizes the
nested
property of theApiProperty
and uses the collection already loaded with the entity when no own resolver is given. I added a Behat test that covers that new scenario.