aws-amplify / amplify-studio

AWS Amplify Studio (Formerly Admin UI)
136 stars 31 forks source link

Nothing shows up on data modeling tap inside Amplify Studio after Amplify CLI Pushing updated Schema.graphql #1000

Open wylliamunlimited opened 1 year ago

wylliamunlimited commented 1 year ago

How did you install the Amplify CLI?

curl

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

No response

Amplify CLI Version

12.2.0

What operating system are you using?

MacOS

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

I have created the schema.graphql manually through vscode. After a couple trial of pushing and receiving errors in the CLI, finally there is no error of the schema that prohibits pushing to Amplify. Once it is pushed, there is no error.

Here is the result of pushing:

`⠏ Building resource api/MyCuteAppName⚠️ WARNING: owners may reassign ownership for the following model(s) and role(s): Item: [currentOwnerUser], Chat: [participantUsers, chatAdminUsers], Comment: [author], Bid: [bidder], Ownership: [ownerUser], Auction: [hostUser], User: [cognito_ID]. If this is not intentional, you may want to apply field-level authorization rules to these fields. To read more: https://docs.amplify.aws/cli/graphql/authorization-rules/#per-user--owner-based-data-access. ⠦ Building resource api/MyCuteAppName✅ GraphQL schema compiled successfully.

Edit your schema at /Users/myName/Desktop/MyCuteAppName/amplify/backend/api/MyCuteAppName/schema.graphql or place .graphql files in a directory at /Users/myName/Desktop/MyCuteAppName/amplify/backend/api/MyCuteAppName/schema

Deployment completed. Deployed api [MyCuteAppName] [ ======================================== ] 22/22 GraphQLAPITransformerSchema3C… AWS::AppSync::GraphQLSchema UPDATE_IN_PROGRESS Tue Jul 25 2023 03:15:1 GraphQLAPIDefaultApiKey215A6D… AWS::AppSync::ApiKey CREATE_IN_PROGRESS Tue Jul 25 2023 03:15:1 GraphQLAPI AWS::AppSync::GraphQLApi UPDATE_IN_PROGRESS Tue Jul 25 2023 03:15:0

Deployed (8 of 8) Deployment state saved successfully.`

Describe the bug

After successfully pushing schema.graphql to amplify (successful here means no error on the CLI interface), tables are created on DynamoDB and schema.graphql is updated on the s3 bucket (directory: s3://deployment/models/appname/schema.graphql). However, when I check the Amplify Studio UI data modeling tap it is completely empty and the deployment button is completely gone. The "deployed" status text next to the data modeling title is there.

Expected behavior

After pushing, I expect to see the schema I created manually on the data modeling tap.

Reproduction steps

  1. edit schema.graphql
  2. amplify push
  3. check amplify studio data modeling tap

Project Identifier

Project identifier: cb9b1c0946b93077f1345eaac0830f50 report-1690293824128.zip

Log output

No response

Additional information

It is best to be solved but if it cannot be solved shortly, I just want to know if this is fine or if any of my file (particularly schema.js) is corrupted leading to empty result on data modeling inside amplify studio.

Before submitting, please confirm:

ykethan commented 1 year ago

hey, 👋 thanks for raising this! I'm going to transfer this over to our studio repository for better assistance 🙂. But I was able to reproduce the issue. marking this as bug for further investigation.

wylliamunlimited commented 1 year ago

Any updates?

ykethan commented 1 year ago

Hey @wyc-wyll, apologies for the delay in a response. The issue appears to be due to the ownerField in the Message model. As a mitigation, we will either need to remove the ownerField reference in the auth directive inside Message model or add the ownerUser field in the Message model.

sudoizh commented 1 year ago

running into the same issue with my project, I had to push the existing API from a local code into the cloud backend. After successfully deploying, I am unable to load the data model, API, and/or Auth in Amplify Studio.

@ykethan - It time critical, therefore need a specific workaround that I could implement. I am trying to follow your last message and I am not quite understanding how I should implement that to my grahpql schema - my understanding is that the Message Model reference is specific to the reporter of this defect and their data model.

ykethan commented 1 year ago

Hey @sudoizh, apologies for the confusion. For example, if you have a data model with the following auth rule

Message:

@auth(
    rules: [
      {
        allow: owner
        ownerField: "ownerAbc"
        operations: [read, create, update]
      }
    ]
  )

the owner field reference to a ownerAbc which currently does not exist on the data model. I was able to get the Data modelling to display the scheme by adding ownerAbc: String(for example) in data model. Could you check if your schema currently has a ownerField as a auth rule but does not have field defined. Additionally, if the owner field is not required for your use case removing should also display the Data modelling page with the schema.

JKeddo95 commented 1 year ago

Hello there!

I'm facing a similar issue where my amplify studio basically is failing to load. I might be looking in the wrong spot, but I don't see any such files in my amplify directory. This issue seems to have started for me after I tried removing graphQL API + some other unused APIs from my app. Any troubleshooting advice would be appreciated.

JKeddo95 commented 1 year ago

Removing my entire API gateway authstack + rules in cli-inputs.json resolves my issue but leaves my API open publicly, which I don't want.

wylliamunlimited commented 1 year ago

Hey @wyc-wyll, apologies for the delay in a response. The issue appears to be due to the ownerField in the Message model. As a mitigation, we will either need to remove the ownerField reference in the auth directive inside Message model or add the ownerUser field in the Message model.

I resolved that issue but the model is still not showing up in the studio modeling tap.

github-actions[bot] commented 1 year ago

⚠️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.

MitchellNeill commented 11 months ago

@ykethan I am also seeing this problem, can't see anything in the Data tap however my data models do not have an ownerField, it may be linked to another issue here though I'm not certain: https://github.com/aws-amplify/amplify-studio/issues/1040.