-
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
Data modeling generates wrong schema #788
Comments
Hey @tbecker, thank you for reaching out. I was able to reproduce the issue. Marking this as bug. Note: Steps to reproduce.
observed: |
Hi ykethan,
great. Please also note that the relationship names are all uppercase, which would create a problem in Flutter afterwards.
Am 10.01.2023 um 20:45 schrieb ykethan ***@***.***>:
Hey @tbecker <https://github.com/tbecker>, thank you for reaching out. I was able to reproduce the issue. Marking this as bug.
Note: Steps to reproduce.
create 3 models A, B and C
A 1:n B
A: 1:n C
B 1:n C
add C belongsTo A
add C belongsTo B
<https://user-images.githubusercontent.com/87995712/211647319-63df6985-8fad-410b-8be1-0babae6c4029.png>
observed:
<https://user-images.githubusercontent.com/87995712/211647077-8cf95ceb-3a9d-420f-8e2d-a620284d8992.png>
—
Reply to this email directly, view it on GitHub <#788 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAEEN3QKVSBNCNQZPCSR33WRW33ZANCNFSM6AAAAAATWKU624>.
You are receiving this because you were mentioned.
Dr. Torsten Becker
BESTgroup Consulting GmbH
Zum Heckeshorn 42k 14109 Berlin Germany
Phone +49 30 80401210
Mobile +49 171 443 1973
www.best-group.eu
|
@tbecker
I am seeing other issues with relationships with Pascal Case field names. It would seem like Amplify studio is very broken. I am also seeing this in the schema.graphql:
I am logging separate issues now for these. but your comment above seemed interesting so I would like to understand the technical constraints. as they are poorly/not documented. |
"great. Please also note that the relationship names are all uppercase, which would create a problem in Flutter afterwards." Dart (the language in Flutter) expect lower case first letter for variables, and the relation would be a variable.... |
@tbecker, How do they relate to Amplify.? |
I have used Amplify in a flutter application. |
Hi @ykethan, |
I am unable to fix my issues. So to proceed I will have to start again from scratch (again!) with a whole new app and a new schema. 2023-09-28T01:01:29.736Z [INFO]: �[K I will test amplify on a few common scenarios before I start again properly. |
I just built a new app with new data model with a few relatioship between tables. I deployed it in Amplify Studio. What on earth is going on? |
Hey @qwikag, sorry to hear about your experience on this. Amplify uses a file called deployment-state.json to maintain deployment state of a push. It appears the file may have not been cleaned on a previous deploy or push. To mitigate the issue we will need to delete this file from the S3 bucket and redo the push. Additionally, the newly created application on studio was the data modelling page greyed out and does the screen show the schema? |
@ykethan,
no schema completely gone. So something in the deployment failed as you suggested. I tried again moments later and it deployed. But fundamenatally the Studio built relational datamodels are very very broken when designed in Studio. |
Before opening, please confirm:
App Id
/dsuhzpzj2hmel/dev/datastore
Region
eu-central-1
Environment name
dev
Figma File Version (if applicable)
No response
Amplify CLI Version
10.6.1
If applicable, what version of Node.js are you using?
No response
What operating system are you using?
Mac
Browser type?
Safari
Describe the bug
I add three models idea, location, profile
Locations is 1:n relationship to profile and ideas, so one location can belong to many profiles and many ideas.
If I create these relationships between the models in visual editor, the code generated for the graphql creates wrong code.
This is the code generated
The last line contains the error.
Expected behavior
I would expect the following result
Reproduction steps
Create three models
Create two 1:n relationships in the visual editor
Change to graphQL scheme
Project Identifier
No response
Additional information
Workaround is to create the file in visual editor, deploy it, fix it locally and push it back
It would also be good, if the relationship name suggestion would be lowercase, as the uppercase creates problems with dart models.
The text was updated successfully, but these errors were encountered: