Last active
February 15, 2020 17:15
-
-
Save dabit3/78112e004e8ab13b0cac04c6d97d08ba to your computer and use it in GitHub Desktop.
How to build a serverless blog back end in one tweet with @awsamplify
This file contains hidden or 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 Blog @model | |
@auth(rules: [ | |
{ allow: groups, groups: ["Admin"] }, { allow: public, operations: [read] } | |
]) { | |
id: ID! | |
name: String! | |
posts: [Post] @connection(name: "BlogPosts") | |
} | |
type Post @model | |
@auth(rules: [ | |
{ allow: owner }, { allow: public, operations: [read] } | |
]) { | |
id: ID! | |
title: String! | |
blog: Blog @connection(name: "BlogPosts") | |
comments: [Comment] @connection(name: "PostComments") | |
} | |
type Comment @model | |
@auth(rules: [ | |
{ allow: owner }, { allow: public, operations: [read] } | |
]) { | |
id: ID! | |
content: String | |
post: Post @connection(name: "PostComments") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See this gist for details of the API CLI workflow.