Last active
May 8, 2018 12:32
-
-
Save gc-codesnippets/b809d9d01ccf6eac40e93314f8f3b4f6 to your computer and use it in GitHub Desktop.
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 User @pgTable(name: "users") { | |
| id: ID! @unique | |
| isAdmin: Boolean! @default(value: false) | |
| posts: [Post!]! | |
| comments: [Comment!]! | |
| } | |
| type Post @pgTable(name: "posts") { | |
| id: ID! @unique | |
| title: String! | |
| text: String! | |
| author: User! @pgRelation(column: "user_id")! | |
| comments: [Comment!]! | |
| } | |
| type Comment @pgTable(name: "comments") { | |
| id: ID! @unique | |
| text: String! | |
| author: User! @pgRelation(column: "user_id")! | |
| post: Post! @pgRelation(column: "post_id") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment