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

Amplify Studio schema is not getting updated #1023

Closed
jvasanthan opened this issue Sep 2, 2023 · 14 comments
Closed

Amplify Studio schema is not getting updated #1023

jvasanthan opened this issue Sep 2, 2023 · 14 comments
Labels
data Data modelling pending-response An issue is pending response from the issue requestor pending-triage An issue that is pending triage question An issue which is a question asked by a customer

Comments

@jvasanthan
Copy link

Which Specific Feature is your question related to?

Amplify Studio UI editing

Question

I updated my schema.graphql with "GraphQL query with sorting by date". After that the changes I make in in the schema in amplify cli is not reflecting in Studio.
How to fix it?

@jvasanthan jvasanthan added pending-triage An issue that is pending triage question An issue which is a question asked by a customer labels Sep 2, 2023
@ykethan
Copy link
Member

ykethan commented Sep 5, 2023

Hey @jvasanthan, could you provide is some additional information on the behavior you are experiencing?

@ykethan ykethan added data Data modelling pending-response An issue is pending response from the issue requestor labels Sep 5, 2023
@ykethan
Copy link
Member

ykethan commented Sep 13, 2023

Following up on this issue, do let us know if you require any further assistance.

@jvasanthan
Copy link
Author

Hi @ykethan

I have a model like below,
type Post{
.
.
owner: ID
.
}

and I updated it to as shown below in Amplify CLI to enable sorted query based on owner.
type Post{
.
.
owner: ID @Index(name: "postsByDate", queryField: "postsByDate", sortKeyFields: ["createdAt"])
.
}

after that if I make any changes in Amplify Studio UI and the model gets overwritten and the sort option is removed from schema.

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Sep 14, 2023
@ykethan
Copy link
Member

ykethan commented Sep 14, 2023

Hey @jvasanthan, thank you for the information. I tried reproducing the issue with the following steps but could not observe this behavior.

  1. Using the Amplify Studio created the following model
type Post @model @auth(rules: [{allow: public}]) {
  id: ID!
  owner: ID
  descp: String
}
  1. Using Amplify CLI pulled the backend and modified the API schema with the following and ran amplify push
type Post @model @auth(rules: [{allow: public}]) {
  id: ID!
  owner: ID @index(name: "postsByDate", queryField: "postsByDate", sortKeyFields: ["createdAt"])
  descp: String
  createdAt: AWSDateTime
}
  1. once the push finished, i refreshed the page and observed

image

Tried deploying resources such as auth but did not observe the sort options being overridden.
Could you provide us information on the changes made in the studio console? Additionally, was the Studio application page refreshed after the amplify push finished?

@ykethan ykethan added the pending-response An issue is pending response from the issue requestor label Sep 14, 2023
@jvasanthan
Copy link
Author

jvasanthan commented Sep 19, 2023

Hi @ykethan

My graphql schema in Amplify CLI looks like this

type Post{
.
.
owner: ID @index(name: "postsByDate", queryField: "postsByDate", sortKeyFields: ["createdAt"])
.
}

and the GraphQL Schema under data modelling in Amplify Studio looks like this

type Post{
.
.
owner: ID
.
}

I don't know why amplify studio isn't showing updated schema

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Sep 19, 2023
@ykethan
Copy link
Member

ykethan commented Sep 19, 2023

Hey @jvasanthan, to ensure some information. could you let me know if the Post model does have @model and @auth directives. Additionally, does you application have multiple environments and in Amplify Studio using the drop down was the expected env selected?
Could you provide us your AppID(from url or the pull command), region and env name?

@ykethan ykethan added the pending-response An issue is pending response from the issue requestor label Sep 19, 2023
@jvasanthan
Copy link
Author

Hi @ykethan
Yes I have multiple environments and Yes the model does have @model and @auth directives.
Is it safe to share the AppId, region in this open forum? Let me know if there is a way I can share it to you in a private message.

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Sep 20, 2023
@ykethan
Copy link
Member

ykethan commented Sep 20, 2023

@jvasanthan Providing the AppID and region should be fine here.
Just to ensure:

  1. could you paste the amplify status output here?
  2. Also If the following env name matches the Current Environment output in the amplify status.

Screenshot 2023-09-20 at 10 31 20 AM

@jvasanthan
Copy link
Author

Hi @ykethan

  1. Amplify status output
    1

  2. Env name in amplify studio
    2

@jvasanthan
Copy link
Author

@ykethan after updating Amplify CLI to latest. I do see the schema in Amplify Studio is updated. I will test and let you know more.

@ykethan
Copy link
Member

ykethan commented Sep 20, 2023

@jvasanthan interesting, would you be open for a call to check the environment?
I am available on discord, my handle is ykethan.

@ykethan ykethan added the pending-response An issue is pending response from the issue requestor label Sep 21, 2023
@ykethan
Copy link
Member

ykethan commented Oct 6, 2023

Following up on this issues, do let us know if you require any further assistance.

@ykethan
Copy link
Member

ykethan commented Oct 11, 2023

Closing the issue due to inactivity. please feel free in reaching out to us again.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 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
data Data modelling pending-response An issue is pending response from the issue requestor pending-triage An issue that is pending triage question An issue which is a question asked by a customer
Projects
None yet
Development

No branches or pull requests

2 participants