diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-08-21 12:16:26 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-08-21 12:16:26 -0400 |
| commit | 3065f07ba8f26c7ccfe440632655fb809dc3ac03 (patch) | |
| tree | c98777028240d1021b63fbc773af24cb4222de71 /stepped-solutions/46/backend/datamodel.graphql | |
| parent | c3bbebfcfeed7a9b8c7470d7b48e12046d834e59 (diff) | |
47
Diffstat (limited to 'stepped-solutions/46/backend/datamodel.graphql')
| -rwxr-xr-x | stepped-solutions/46/backend/datamodel.graphql | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/stepped-solutions/46/backend/datamodel.graphql b/stepped-solutions/46/backend/datamodel.graphql new file mode 100755 index 0000000..9786a4b --- /dev/null +++ b/stepped-solutions/46/backend/datamodel.graphql @@ -0,0 +1,37 @@ +enum Permission { + ADMIN + USER + ITEMCREATE + ITEMUPDATE + ITEMDELETE + PERMISSIONUPDATE +} + +type User { + id: ID! @unique + name: String! + email: String! @unique + password: String! + resetToken: String + resetTokenExpiry: String + permissions: [Permission] + cart: [CartItem!]! +} + +type Item { + id: ID! @unique + title: String! + description: String! + image: String + largeImage: String + price: Int! + user: User! +} + + +type CartItem { + id: ID! @unique + quantity: Int! @default(value: 1) + item: Item # relationship to Item + user: User! # relationship to User +} |
