Bugfix: Respect input DTO without adding additional id field#5095
Conversation
|
It's totally Why not using an allow list like suggested in the issue? |
|
Thanks @alanpoulain for your quick feedback. Maybe it was a mistake from my side to promote this issue as a workaround for #2736. But as mentioned it can additionally be considered as a workaround for #2736. But you are right, it does not mainly fix this issue and the propsal using an allow list will be still open. Sorry for misunderstanding. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
6f7b30c to
2960b99
Compare
b1d40d8 to
8f86e31
Compare
8f86e31 to
1801dfa
Compare
|
Thank you @jotwea. |
|
After some thought, maybe I will revert this PR. The condition is not right: we don't want to remove the ID for update and delete mutations. |
|
WDYT of this PR to replace yours? |
|
I guess #5359 also solves the original problem mentioned in #5097 very well. Your approach differs from mine that it is based on the existence of a |
|
Thanks for the answer. |
…d input type (api-platform#5095) Co-authored-by: josef.wagner <[email protected]>
…d input type (api-platform#5095) Co-authored-by: josef.wagner <[email protected]>
…d input type (api-platform#5095) Co-authored-by: josef.wagner <[email protected]>
…d input type (api-platform#5095) Co-authored-by: josef.wagner <[email protected]>
…d input type (api-platform#5095) Co-authored-by: josef.wagner <[email protected]>
For all GraphQL mutations except
createtheidfield is added automatically. Also for scenarios where an input DTO is used theidgot added. This PR respects the given input DTO and will not add an additionalidfield. If you need the id your DTO may contain it.The related Ticker #2736 is not completely solved with this PR but it enables the workaround to have multipe create mutations by using a specifiy input DTO.
Branch:
main, because not sure if it is a real bugfix or more a tiny new feature.Note: Failing PHP-cs-fixer is not related to the changes in this PR