Skip to content
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

DataStore does not support 1 to 1 connection with both sides of connection as optional field #1533

Closed
2 tasks done
cunneen opened this issue Jun 2, 2023 · 2 comments
Closed
2 tasks done
Assignees
Labels
DataStore duplicate This issue or pull request already exists pending-triage

Comments

@cunneen
Copy link

cunneen commented Jun 2, 2023

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v16.20.0

Amplify CLI Version

12.0.0

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

no manual changes; attempt at fresh environment creation fails.

Describe the bug

On first push to a new environment (i.e. amplify env add test), I get the following error :

DataStore does not support 1 to 1 connection with both sides of connection as optional field: ClassroomYearLevel.yearLevel

But the ClassroomYearLevel.yearLevel field is marked as mandatory in the graphql schema:

type ClassroomYearLevel
  @model(subscriptions: null)
  @key(
    name: "byClassroom"
    fields: ["classroomID"]
    queryField: "getClassroomYearLevels"
  )
  @key(
    name: "bySchoolByYearLevel"
    fields: ["schoolID", "yearLevelID"]
    queryField: "getSchoolClassroomsByYearLevel"
  )
  @key(
    name: "byClassroomYearLevel"
    fields: ["classroomID", "yearLevelID"]
    queryField: "getClassroomYearLevelByID"
  )
 {
  id: ID!
  classroomID: ID!
  classroom: Classroom! @connection(fields: ["classroomID"])
  schoolID: ID!
  school: School! @connection(fields: ["schoolID"])
  yearLevelID: ID!
  yearLevel: YearLevel! @connection(fields: ["yearLevelID"])
}

Expected behavior

This schema has been pushed successfully to other environments, I expected the same.

Reproduction steps

I don't know.

Project Identifier

5fb3a1445772fd14883df70013b7a231

Log output

# Put your logs below this line

[amplify-cli-2023-06-03.log](https://github.com/aws-amplify/amplify-cli/files/11638477/amplify-cli-2023-06-03.log)

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@chrisbonifacio chrisbonifacio transferred this issue from aws-amplify/amplify-cli Jun 2, 2023
@cunneen
Copy link
Author

cunneen commented Jun 4, 2023

Reverting Amplify CLI to v10.8.1 via the web console's build settings works. We also tried v11.1.1 and that version exhibited the error.

@AnilMaktala AnilMaktala added the duplicate This issue or pull request already exists label Jun 5, 2023
@AnilMaktala
Copy link
Member

AnilMaktala commented Jun 5, 2023

Hey @cunneen, This issue has already been reported as #1419. Please subscribe to #1419 to receive future updates on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DataStore duplicate This issue or pull request already exists pending-triage
Projects
None yet
Development

No branches or pull requests

3 participants