[GraphQL] Fix type for subresource#1702
Merged
dunglas merged 4 commits intoFeb 12, 2018
Merged
Conversation
dunglas
approved these changes
Feb 12, 2018
alanpoulain
force-pushed
the
fix/graphql-iri-subresource
branch
from
February 12, 2018 12:41
1f980ff to
b55fd04
Compare
Member
|
Thanks @alanpoulain |
|
Hi, I understand your choice and difficulties to implement nested mutations. But i find this rather sad. Nested mutations are a solution to solve multiple HTTP call problems from client. A project like GraphCool has choose to implement this feature in 2016/10: https://blog.graph.cool/improving-dx-with-nested-mutations-698c508339ca Hope it will exists one day in api-platform |
Member
|
Something like batch operations may be more suitable for this particular issue, see #1645 |
|
i have to investigate on batch operations, but to my mind batch are for recurrent operations of the same kind, here operations can be over different object. I'll give it a try (if i find enough documentation about it :) |
hoangnd25
pushed a commit
to hoangnd25/core
that referenced
this pull request
Feb 23, 2018
* Add a depth variable in SchemaBuilder * Pagination should not be used for input * String type (IRI) if depth > 0 (= subresource) for input * Add a test for a mutation with a subresource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nested mutations are not a part of the specification. See:
Moreover, it would be laborious to implement it. We would have to change the behavior of the ItemNormalizer and we would have to move the validation/access control of the resolver elsewhere to be reused in the normalizer.
Therefore, it seems a better solution to force IRIs for subresources in mutations.
This PR also fixes an issue with input types: pagination should not be used for them.