Skip to content

Commit

Permalink
Adding Backend
Browse files Browse the repository at this point in the history
  • Loading branch information
michelmany committed Mar 19, 2020
1 parent def5087 commit 88e03d6
Show file tree
Hide file tree
Showing 15 changed files with 13,392 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/.graphqlconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
projects:
app:
schemaPath: "src/schema.graphql"
extensions:
endpoints:
default: "http://localhost:4444"
prisma:
schemaPath: "src/generated/prisma.graphql"
extensions:
prisma: prisma.yml
57 changes: 57 additions & 0 deletions backend/datamodel.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
enum Permission {
ADMIN
USER
ITEMCREATE
ITEMUPDATE
ITEMDELETE
PERMISSIONUPDATE
}

type User {
id: ID! @unique
name: String!
email: String! @unique
password: String!
resetToken: String
resetTokenExpiry: Float
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
}

type OrderItem {
id: ID! @unique
title: String!
description: String!
image: String!
largeImage: String!
price: Int!
quantity: Int! @default(value: 1)
user: User
}

type Order {
id: ID! @unique
items: [OrderItem!]!
total: Int!
user: User!
charge: String!
createdAt: DateTime!
updatedAt: DateTime!
}
Loading

0 comments on commit 88e03d6

Please sign in to comment.