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

Example for one-to-many (Invoice/Order) #46

Open
frederikhors opened this issue Dec 4, 2020 · 3 comments
Open

Example for one-to-many (Invoice/Order) #46

frederikhors opened this issue Dec 4, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@frederikhors
Copy link

frederikhors commented Dec 4, 2020

Do we have an example of how to manage a one-to-many model?

Example: an invoice with multiple rows. When I create or update an invoice the rows are saved or modified or deleted at the same time.

@RichardLindhout
Copy link
Member

I now always create the invoice directly in my UI and save the rows after that with the calls for that.
However for some use cases it would be better to have a graphql call which does all of that at once.

For now only one-to-one relationships are possible if you change the schema.grapql the right resolvers will be created, we don't support one-to-many yet you would need to customize your resolver for this use case.

It really need to be simpler though to create custom resolvers without opting out of the generated resolver process, we would like to add this in the future.

@RichardLindhout RichardLindhout self-assigned this Dec 4, 2020
@RichardLindhout RichardLindhout added the enhancement New feature or request label Dec 4, 2020
@frederikhors
Copy link
Author

I can use two calls too. But I need to do this calls in a DB transaction, so one call. I can change that, I know, but sometimes I can't.

@RichardLindhout
Copy link
Member

RichardLindhout commented Dec 4, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants