drizzle-graphql icon indicating copy to clipboard operation
drizzle-graphql copied to clipboard

Drizzle add relational objects during insert/update?

Open anthonyhoegberg opened this issue 1 year ago • 2 comments

Is it possible to get relations in the mutations (insert/update) as well, like lets say we have a user and a post table currently when i do a query i can request the posts as well however i would also like to be able to add posts during the creation of the user object.

when i create a user, i would like to also add posts as a subfield in the generated UserInsertInput type so when i create the user object, i can attach posts to it instead of doing 2 different inserts.

This might not be a good example with user and post, but i have other data where this would be the easiest way to insert a lot of data at once, and i have many different relations aswell

anthonyhoegberg avatar Apr 22 '24 02:04 anthonyhoegberg

I'll check if and how that's possible to implement, would likely need Drizzle RQB to support such actions to begin with.

Sukairo-02 avatar Apr 22 '24 09:04 Sukairo-02

Thank you for your quick response

anthonyhoegberg avatar Apr 22 '24 23:04 anthonyhoegberg

It's not something I can implement without Drizzle doing it first in the RQB, so until then this issue is on hold.

Sukairo-02 avatar May 27 '24 14:05 Sukairo-02