-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
DataStoreDocumentation dealing with the DataStore, can be for any/all platform(s)Documentation dealing with the DataStore, can be for any/all platform(s)amplify/dataIssue related to aws-amplify/amplify-category-apiIssue related to aws-amplify/amplify-category-apip2incorrect info. ie a bugincorrect info. ie a bug
Description
Describe the content issue:
A clear and concise description of what the content issue is. Is there content missing or is there incorrect content?
See the following updated schema as described in the docs:
enum PostStatus {
ACTIVE
INACTIVE
}
type Post @model {
id: ID!
title: String!
rating: Int!
status: PostStatus!
# New field with @hasMany
comments: [Comment] @hasMany(indexName: "byPost", fields: ["id"])
}
# New model
type Comment @model {
id: ID!
postID: ID! @index(name: "byPost")
post: Post! @belongsTo(fields: ["postID"])
content: String!
}
You’ll notice that Comment has a required postID
, as well as a required post
. This means when we save the Comment, both the instance and postID are required.
As of now, if a customer uses the code samples in the docs with this schema, they’ll get type errors (i.e. that postId
is required when using this code example).
URL page where content issue is:
https://docs.amplify.aws/lib/datastore/relational/q/platform/js/#saving-relations
Metadata
Metadata
Assignees
Labels
DataStoreDocumentation dealing with the DataStore, can be for any/all platform(s)Documentation dealing with the DataStore, can be for any/all platform(s)amplify/dataIssue related to aws-amplify/amplify-category-apiIssue related to aws-amplify/amplify-category-apip2incorrect info. ie a bugincorrect info. ie a bug