summaryrefslogtreecommitdiffstats
path: root/backend/database/datamodel.graphql
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-02-13 13:19:23 -0500
committerWes Bos <wesbos@gmail.com>2018-02-13 13:19:23 -0500
commitfa3ec3299b3fa33e5a699683beb96cfa4e6dd51d (patch)
tree601b4ff9650cd17a6d4181fc5982b401411d2a6a /backend/database/datamodel.graphql
parente0d0baa75ec0bf617f91b6cd779305d4009cae12 (diff)
getting there
Diffstat (limited to 'backend/database/datamodel.graphql')
-rw-r--r--backend/database/datamodel.graphql13
1 files changed, 12 insertions, 1 deletions
diff --git a/backend/database/datamodel.graphql b/backend/database/datamodel.graphql
index 4620206..ed70892 100644
--- a/backend/database/datamodel.graphql
+++ b/backend/database/datamodel.graphql
@@ -14,6 +14,7 @@ type User {
password: String!
name: String!
posts: [Post!]!
+ orders: [Order!]!
website: String
age: Int
resetToken: String
@@ -24,12 +25,22 @@ type User {
type CartItem {
id: ID! @unique
quantity: Int! @default(value: 1)
- item: Item!
+ item: Item! # Relationship to an Item
+ user: User! # Relationship to a user
}
type Item {
id: ID! @unique
title: String!
description: String!
+ image: String
price: Int!
}
+
+type Order {
+ id: ID! @unique
+ items: [Item!]!
+ total: Int!
+ user: User!
+ charge: String!
+} \ No newline at end of file