-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support collection in setter #11
Comments
You most likely did nothing wrong. The case you describe is not specifically supported yet, so it is very likely that what you experience is the result of a bug-ish behavior. What would you expect to happen from the API user point of view ? Give an array of ID ? Then from the resolver point of view, what would you expect to receive ? a Doctrine Collection automatically filled with entities loaded from the array of ID ? Would you like to open a PR to add a failing unit tests to the project that would illustrate your use-case ? You could probably add a |
Yes, sounds good.
Yes, sounds good. Maybe out of scope for this issue: could this result in an out-of-memory exception and if yes, how do we handle it? I've forked & branched the repository, but do you have any pointers on where to get started with writing a test for this? I've added |
If you added a setter, then I would expect Then for the resolver part, I'm not quite sure yet, but it would most likely be similar to Let's start with your failing test first, create a work-in-progress PR with whatever you have and we can work on that... |
Needed this functionality. I will start to implement this. |
I've started using this library recently and love it so far, I have a small support request though. :-)
Currently, I have a mutation that allows a user to create a Company.
The Company model holds a Collection (Doctrine) of objects of the Entity Contact. Retrieving the Collection through GraphQL is not a problem:
I have annotated Company::getContacts() using the Field annotation as per the documentation (this works, but am I doing this the right way?).
Setting the collection however, does not work. This code:
Results in this error:
What am I doing wrong?
Thanks in advance!
PS: I'm using ecodev/graphql-doctrine:2.0.1 and webonyx/graphql-php:v0.11.6.
The text was updated successfully, but these errors were encountered: