Open matart15 opened 1 year ago
Hi @matart15 sending this to the Studio repo for better assistance
Hey @matart15, thank you for reaching out. Currently, Amplify form builder does not support non model types, required relationships or required fields. For the models to appear in the form builder, I would suggest modifying the fields as non required.
For example:
type Workflow @model @auth(rules: [{allow: public}]) {
id: ID!
Steps: [Step] @hasMany(indexName: "byWorkflow", fields: ["id"])
}
enum FormFieldType {
SHORT_TEXT
NUMBER
CHOICE
LONG_TEXT
}
type FormField @model @auth(rules: [{allow: public}]) {
id: ID!
stepID: ID @index(name: "byStep")
label: String
name: String
type: FormFieldType
placeholder: String
dateName: String
isRequired: Boolean
}
type Step @model @auth(rules: [{allow: public}]) {
id: ID!
FormFields: [FormField] @hasMany(indexName: "byStep", fields: ["id"])
workflowID: ID @index(name: "byWorkflow")
}
On modifying to the above schema, I was able to build forms for the Step and FormField models.
@tannerabread @ykethan Thank you.
For now I will change my model fields into non required. then change back when I finish building UI.
should I create new issue for feature request?
Hey @matart15, I will mark this issue as feature request to enable support for form creation when relationships and fields are required
Here is much easier aws amplify forms solution. Check it out.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Not applicable
Amplify Categories
Not applicable
Environment information
Describe the bug
I have 3 data models. none of them set auth rules.
I did not create Form on Steps and FieldSettings
When I try to create Step Form
It does not show up. Only 1 of them shows
Expected behavior
all three data model show up on Form builder
Reproduction steps
create 3 data model
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response