summaryrefslogtreecommitdiffstats
path: root/backend/database/datamodel.graphql
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-03-28 15:22:34 -0400
committerWes Bos <wesbos@gmail.com>2018-03-28 15:22:34 -0400
commit65c524251d49ade9d44a62337f3c1c1fed6eedd0 (patch)
treed504ba9cea8d89bbde4b2e809fddb048bd660548 /backend/database/datamodel.graphql
parenta1fd7eb33bb08610aaf381a64b7f963cd98bfdaa (diff)
Permissions
Diffstat (limited to 'backend/database/datamodel.graphql')
-rw-r--r--backend/database/datamodel.graphql21
1 files changed, 10 insertions, 11 deletions
diff --git a/backend/database/datamodel.graphql b/backend/database/datamodel.graphql
index f31a089..43ae403 100644
--- a/backend/database/datamodel.graphql
+++ b/backend/database/datamodel.graphql
@@ -1,11 +1,11 @@
-type Post {
- id: ID! @unique
- createdAt: DateTime!
- updatedAt: DateTime!
- isPublished: Boolean! @default(value: "false")
- title: String!
- text: String!
- author: User!
+enum Permission {
+ ADMIN
+ USER
+ ITEMCREATE
+ ITEMUPDATE
+ ITEMDELETE
+ PERMISSIONUPDATE
+ NUKE
}
type User {
@@ -13,15 +13,13 @@ type User {
email: String! @unique
password: String!
name: String!
- posts: [Post!]!
orders: [Order!]!
- website: String
- age: Int
resetToken: String
resetTokenExpiry: String
cart: [CartItem!]!
createdAt: DateTime!
updatedAt: DateTime!
+ permissions: [Permission!]!
}
type CartItem {
@@ -42,6 +40,7 @@ type Item {
price: Int!
createdAt: DateTime!
updatedAt: DateTime!
+ user: User! # Relationship to a user
}
type OrderItem {