-
-
Notifications
You must be signed in to change notification settings - Fork 892
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] Custom mutations on collections / return type #2947
Comments
Another possible solution might be to allow specifying the return type, similar to the way |
I don't think the second solution is OK for this specific need (but it could be another enhancement) because the used resolver is only for queries, not mutations. |
Could you explain what you mean? And yes, you can send multiple mutations - but that would require you to dynamically build the mutations in the client side (which might involve a lot of work or be impossible depending on the libraries or client you use) - while having one mutation with an array argument will allow you to use the same mutation with different variables. Also there will probably be other use cases for a custom return type (e.g. mutations that should just return a single value, like a number or boolean) - just as the |
So the situation we are wanting to use this for is "claimBooks", where a user claims any books that have been associated with their phone number at a checkout, but they signed up as a user afterwards and gave their phone number. In this case, we are updating multiple books to have their owner be the user, and would like to return that collection from the mutation. At the moment, this does not seem to be possible. |
Similar to
collection_query
there should becollection_mutation
for mutations that operate on multiple Resources, e.g. deleting multiple items in a single request by passing an array of IDs.The text was updated successfully, but these errors were encountered: