Skip to content
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

API Generator: Generate better API for Many-to-one-relations with orphanRemoval activated where the reverse side has its own API generated #1478

Merged
merged 24 commits into from
Mar 5, 2024

Conversation

nsams
Copy link
Member

@nsams nsams commented Dec 4, 2023

  • Add id as argument to create mutation
  • Add id as argument to list query

@nsams nsams requested a review from johnnyomair December 4, 2023 16:59
@nsams nsams force-pushed the apigen-mainproperty branch from 27a4b3f to d877ee1 Compare December 4, 2023 17:00
@nsams nsams force-pushed the apigen-mainproperty branch from d877ee1 to 46b67c6 Compare December 5, 2023 07:15
@nsams nsams self-assigned this Dec 5, 2023
@nsams nsams changed the title CRUD Generator: Add the concept of mainProperty that can be set in @CrudField for a ManyToOne relation Api CRUD Generator: Generate better Api for non nullable ManyToOne relations Dec 6, 2023
nsams added 2 commits December 6, 2023 18:11
…rudField for a ManyToOne relation

This will generate an api for sub entities, similar to scope.
Example: Product Variants

Usage:
@CrudField({ mainProperty: true })

Generated is the following:
- a product id argument for the get-many query
- a product id argument for the create mutation

TODO:
- [ ] find a better name
@nsams nsams force-pushed the apigen-mainproperty branch from 6681366 to d1e6d7c Compare December 6, 2023 17:12
@nsams nsams changed the base branch from main to next December 6, 2023 17:12
@nsams
Copy link
Member Author

nsams commented Dec 6, 2023

I replaced the mainProperty option with detection of non-nullable relations. Thanks for the idea @fraxachun

reverted

@nsams nsams marked this pull request as draft December 13, 2023 18:30
@johnnyomair johnnyomair removed their request for review January 10, 2024 12:51
@nsams nsams changed the title Api CRUD Generator: Generate better Api for non nullable ManyToOne relations CRUD Generator: Add the concept of rootArg that can be set in @CrudField for a ManyToOne relation Feb 8, 2024
@nsams nsams requested a review from johnnyomair February 8, 2024 09:40
@nsams nsams marked this pull request as ready for review February 8, 2024 09:40
@nsams
Copy link
Member Author

nsams commented Feb 13, 2024

@johnnyomair ready to review

@johnnyomair
Copy link
Collaborator

@nsams please fix conflicts, thanks!

@johnnyomair johnnyomair changed the title CRUD Generator: Add the concept of rootArg that can be set in @CrudField for a ManyToOne relation API Generator: Generate better API for Many-to-one-relations with orphanRemoval activated where the reverse side has its own API generated Mar 4, 2024
@johnnyomair
Copy link
Collaborator

@nsams should we merge this into main or next? It could take some time before we release the next major version

@nsams
Copy link
Member Author

nsams commented Mar 5, 2024

@nsams should we merge this into main or next? It could take some time before we release the next major version

it is an incomaptible change, as it is now not a new option anymore

@johnnyomair
Copy link
Collaborator

@nsams conflicts 🙄

@nsams
Copy link
Member Author

nsams commented Mar 5, 2024

yes, I'm at it

@nsams nsams requested a review from johnnyomair March 5, 2024 08:55
@johnnyomair johnnyomair merged commit 9bed756 into next Mar 5, 2024
10 checks passed
@johnnyomair johnnyomair deleted the apigen-mainproperty branch March 5, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants