Skip to content

Instantly share code, notes, and snippets.

@dabit3
Last active February 15, 2020 17:15
Show Gist options
  • Save dabit3/78112e004e8ab13b0cac04c6d97d08ba to your computer and use it in GitHub Desktop.
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
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")
}
@dabit3
Copy link
Author

dabit3 commented Feb 14, 2020

See this gist for details of the API CLI workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment