Created
October 22, 2020 00:05
-
-
Save dabit3/31edec32294575594b054bbe6df00c4b to your computer and use it in GitHub Desktop.
Next.js + Amplify - schema.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Post @model | |
@auth(rules: [ | |
{ allow: owner, ownerField: "username" }, | |
{ allow: public, operations: [read] } | |
]) { | |
id: ID! | |
name: String! | |
content: String | |
comments: [Comment] @connection(keyName: "commentsByPostId", fields: ["id"]) | |
username: String | |
createdAt: AWSDateTime | |
} | |
type Comment @model | |
@key(name: "commentsByPostId", fields: ["postId"], queryField: "commentsByPostId") | |
@auth(rules: [ | |
{ allow: owner, ownerField: "username" }, | |
{ allow: public, operations: [read] } | |
]) { | |
id: ID! | |
postId: ID! | |
message: String! | |
username: String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment