-
Notifications
You must be signed in to change notification settings - Fork 31
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
schema.graphql has incorrect duplicate relationships. #1044
Comments
This is the schema that the docs say is the norm:
the difference with this from mine:
It is highly likely the cli I picking up the double "byPerson" and causing a rewrite the the schema. also the console is not helping by not enabling a write to these relationships and creating a duplicate "byPerson" |
Hey @qwikag, thank you for reaching out. The error appears to be occurring due to |
Hi @ykethan, Created in Amplify Studio (Setup --> Data) Maybe update by cli??? The problem here is the documentation about how to put together a good data-model, is weak, and needs a lot of work to communicate the idiosyncrasies. I think console data modeling is broken, because that is where I started, and things have gone nasty. |
Hey @qwikag, I was able to reproduce the issue. Similar to #788 the visual editor creates a duplicate relationship. Reproduction steps:
The B models seems to have a duplicate relationship Marking as bug. I do agree the documentation could be improved to provide better information on creating a data modelling schema. Let pass this feedback to the team in improving the documentation. Thank you for taking the time in reaching out and providing this feedback. |
Before opening, please confirm:
App Id
whyputappidinpublicforum
Region
ap-southeast-2
Environment name
develop
Figma File Version (if applicable)
N/A
Amplify CLI Version
No response
If applicable, what version of Node.js are you using?
No response
What operating system are you using?
win10
Browser type?
chrome
Describe the bug
Cannot publish a new relationship with Pascal Case:
e.g.
type Person @model @auth(rules: [{allow: owner, operations: [read, update, create]}, {allow: private, operations: [create, read, update], provider: iam}]) {
id: ID!
Email: AWSEmail!
Username: AWSEmail
Firstname: String
Lastname: String
Mobile: AWSPhone
Birthdate: AWSDate
Address: String
Phone: AWSPhone
SystemLogs: [SystemLog] @hasmany(indexName: "byPerson", fields: ["id"])
Logins: [SystemLog] @hasmany(indexName: "byPerson", fields: ["id"])
Bookings: [Booking] @hasmany(indexName: "byPerson", fields: ["id"])
}
type Booking @model @auth(rules: [{allow: private, operations: [read]}, {allow: owner, operations: [create, read, update]}]) {
id: ID!
Name: String!
Start: AWSDateTime
Stop: AWSDateTime
OrgID: ID! @Index(name: "byOrganisation")
Status: String
OrganiserId: [Booking] @Index(name: "byPerson")
}
I get this error
Expected behavior
It should work just fine.
Reproduction steps
create parent child relationship with aand change the field name from
e.g. "personID" --> "PersonId"
Project Identifier
1d91fff5a13778a3f2da7571d70fa642
Additional information
NB: the duplicated SystemLog relationship on the Logins, is also very incorrect. It should be "Login".
I have multiple instances of this happening.
This too is a separate problem I am logging.
Amplify& AWS is hugely broken, and no longer worth getting involved in until these issues (and many more) get fixed.
I now have to take my business elsewhere.
AWS need to take a look at Salesforce and how successful their easy data modelling has been over the last 20years, seldom a failure.
And this is due to quality implementation of front end delivering on backend capability.
The text was updated successfully, but these errors were encountered: