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

Data manager - Form generation fails with the error 'Cannot find associated fields to build <field name>' #825

Closed
4 tasks done
abhi7cr opened this issue Feb 14, 2023 · 5 comments
Labels
bug An issue which has been identified as a bug cms An issue identified as a cms bug/feature studio-ui An issue that needs to be tracked by Studio Console team

Comments

@abhi7cr
Copy link
Contributor

abhi7cr commented Feb 14, 2023

Before opening, please confirm:

App Id

d1jfnieu79l7n0

Region

eu-west-2

Environment name

dev

Figma File Version (if applicable)

No response

Amplify CLI Version

No response

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

No response

What operating system are you using?

Mac

Browser type?

Google Chrome

Describe the bug

Opening the Create User form in Data Manager for the following schema throws the error:

Something went wrong. Please try again.
Cannot find associated fields to build EntriesCannot find associated fields to build Entries

Schema

type User @model @auth(rules: [{allow: public}]) {
  id: ID!
  status: AWSJSON
  email: String!
  name: String
  config: AWSJSON
  settings: AWSJSON
  Entries: [Entry] @hasMany(indexName: "byUser", fields: ["id"])
  Images: [Image] @hasMany(indexName: "byUser", fields: ["id"])
}

type Entry @model @auth(rules: [{allow: public}]) {
  id: ID!
  status: String
  type: AWSJSON
  date: AWSDateTime!
  notes: String
  conditions: AWSJSON
  treatments: AWSJSON
  meta: AWSJSON
  userID: ID! @index(name: "byUser")
  User: User @belongsTo(fields: ["userID"])
  Images: [Image] @hasMany(indexName: "byEntry", fields: ["id"])
}

type Image @model @auth(rules: [{allow: public}]) {
  id: ID!
  status: String
  view: AWSJSON
  path: AWSJSON
  date: AWSDateTime
  notes: String
  meta: AWSJSON
  userID: ID! @index(name: "byUser")
  entryID: ID! @index(name: "byEntry")
  User: User @belongsTo(fields: ["userID"])
  Entry: Entry @belongsTo(fields: ["entryID"])
}

Something went wrong. Please try again.
Cannot find associated fields to build EntriesCannot find associated fields to build Entries

Expected behavior

I should be able to create a record / autogenerate record for User model.

Reproduction steps

  1. Deploy above schema
  2. Go to Data manager
  3. Click Create User to see the error

Project Identifier

No response

Additional information

No response

@abhi7cr abhi7cr added the pending-triage An issue that is pending triage label Feb 14, 2023
@ykethan
Copy link
Member

ykethan commented Feb 14, 2023

Was able to reproduce the issue, marking as bug.
image

@abhi7cr could you also check out the behaviour i observed on #824 (comment)

@ykethan ykethan added bug An issue which has been identified as a bug studio-ui An issue that needs to be tracked by Studio Console team cms An issue identified as a cms bug/feature and removed pending-triage An issue that is pending triage labels Feb 14, 2023
@hein-j
Copy link

hein-j commented Feb 16, 2023

Related issue: Incorrect join table identification -

type Box @model @auth(rules: [{allow: public}]) {
  id: ID!
  name: String
  crateID: ID! @index(name: "byCrate")
  Crate: Crate @belongsTo(fields: ["crateID"])
}

type Crate @model @auth(rules: [{allow: public}]) {
  id: ID!
  destination: String
  Boxes: [Box] @hasMany(indexName: "byCrate", fields: ["id"])
}

@VijiGeo
Copy link

VijiGeo commented Feb 18, 2023

+1, am seeing this issue -- creating an "Entry" with no "User" leads to the data manager infinitely loading as well.

Screenshot 2023-02-18 at 12 51 10 AM

@ykethan
Copy link
Member

ykethan commented Mar 26, 2023

closing the issue as the fix has been merged.

@ykethan ykethan closed this as completed Mar 26, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue which has been identified as a bug cms An issue identified as a cms bug/feature studio-ui An issue that needs to be tracked by Studio Console team
Projects
None yet
Development

No branches or pull requests

4 participants