Scaffold generator for prisma relations

I’ve finished the Redwoodjs tutorial using Redwoodjs 0.2.5 version (os: Windows 10, node : 12.6.1, yarn: 1.21.1)

I generated a scaffold for product using this schema after saving and committing the db
‘yarn rw g scaffold product’

//schema.prisma
datasource DS {
provider = “sqlite”
url = env(“DATABASE_URL”)
}

generator photonjs {
provider = “prisma-client-js”
}

model Product {
id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now())
updatedAt DateTime
variant Variant[]
}

model Variant {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime
title String
product Product
}

Using Form generated by the scaffold, how do I edit and save ‘variant’ in ‘Post’ Model and edit ‘product’ in ‘Variant’

  1. I am gettings errors at web and api side
    a) not defined fields for product in Variant and not defined fields for variant in ‘Product’ in generated query
    b) while submitting the data to the server, ID is a string when Int is expected errors from the remote graphql server

Ah, there’s a lot of conversation in process about getting relations to work properly. Could you see if this example helps answer your question?

And re: Form – you’ll need to build your own form for this as well (not using the generators).

Appreciate you extending the concepts and trying to make them work! Keep us posted.