Skip to content

Instantly share code, notes, and snippets.

@nikolasburk
Created March 13, 2019 19:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikolasburk/db3c8e052c8e640f51f60c1ac16d92d8 to your computer and use it in GitHub Desktop.
Save nikolasburk/db3c8e052c8e640f51f60c1ac16d92d8 to your computer and use it in GitHub Desktop.
type Post {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
title: String!
published: Boolean! @default(value: "false")
author: User
comments: [Comment!]!
}
type User {
id: ID! @unique
name: String
email: String! @unique
role: Role! @default(value: "USER")
posts: [Post!]!
comments: [Comment!]!
}
type Comment {
id: ID! @unique
createdAt: DateTime!
text: String!
post: Post!
writtenBy: User!
}
enum Role {
USER
ADMIN
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment