aws-amplify / aws-amplify/amplify-studio

model with index and sort causes sync issue on data manager

Open
#939 1 comment 0 reactions 0 assignees View on GitHub
bug cms 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

d3agmbof1zzckq

### Region

us-east-1

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

_No response_

### Browser type?

_No response_

### Describe the bug

using the following model

```graphql
type Message @model @auth(rules: [{allow: public}]) {
id: ID!
text: String
type: String @index(name: "messagesByDate", queryField: "messagesByDate", sortKeyFields: ["createdAt"])
createdAt: String
}
```
and creating a record with the following

image

results in the following and does not change state
image

error on networking tab

```json
{"data":{"createMessage":null},"errors":[{"path":["createMessage"],"data":null,"errorType":"DynamoDB:DynamoDbException","errorInfo":null,"locations":[{"line":2,"column":3,"sourceName":null}],"message":"One or more parameter values were invalid: Type mismatch for Index Key createdAt Expected: S Actual: NULL IndexName: messagesByDate (Service: DynamoDb, Status Code: 400, Request ID: GIG0V003AI19AR231KSTNQ1GIBVV4KQNSO5AEMVJF66Q9ASUAAJG)"}]}
```

### Expected behavior

display error is mutation fails and work as expected

### Reproduction steps

1. use the data model provided then push using amplify cli
2. open data manager
3. create a record

### Project Identifier

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure from the provided GraphQL model by pushing it with Amplify CLI, opening Data Manager, and creating a record with the indexed and sorted fields. Inspect the networking-tab mutation error and the Data Manager state; done means the mutation failure is displayed clearly and the record state behaves as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, graphql
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.