aws-amplify / aws-amplify/amplify-studio

schema.graphql has incorrect duplicate relationships.

Open
#1,044 4 comments 0 reactions 0 assignees View on GitHub
bug data studio-ui
Dominant language
No language data
Stars
135
Forks
32
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-adminui/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-adminui/blob/main/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### 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
![DeploymentOrganiserId](https://github.com/aws-amplify/amplify-studio/assets/5670636/d32acb7b-ed69-4686-8b34-1de79a807c50)

### 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.

Contributor guide

Open the contributing guide

Research direction

Start with the schema.graphql example and reproduce the issue by renaming a parent-child relationship field from personID to PersonId. Check the generated relationship names, including the duplicated SystemLog relationship, and verify that the corrected schema publishes successfully without the reported deployment error.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.