postgraphile-plugin-nested-mutations
postgraphile-plugin-nested-mutations copied to clipboard
Impossible to connect many-to-many relation in one step
When i create record datum
, which has connection to user
, i cannot connect it in same mutation where I create it, because nested mutation wants dataId
and i dont have that yet, until datum
is created.
const req: Request<MutationCreateDatumArgs> = {
mutation: CreateDatum,
variables: {
input:{
userData: {
connectByUserIdAndDataId: [
{
dataId: null, // I dont have this yet
userId: 'Hn67I7nMY9TcBnXsH32UOgFToBf1'
}
]
}
}
}