Skip to content

Commit

Permalink
getting there
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbos committed Sep 7, 2018
1 parent 9876e7d commit 093c172
Show file tree
Hide file tree
Showing 26 changed files with 3,031 additions and 8 deletions.
8 changes: 4 additions & 4 deletions finished-application/frontend/__tests__/SingleItem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ describe('<SingleItem/>', () => {
request: { query: SINGLE_ITEM_QUERY, variables: { id: '123' } },
result: { data },
},
{
request: { query: CURRENT_USER_QUERY },
result: { data: { me: fakeUser() } },
},
// {
// request: { query: CURRENT_USER_QUERY },
// result: { data: { me: fakeUser() } },
// },
];
const wrapper = mount(
<MockedProvider mocks={mocks}>
Expand Down
17 changes: 13 additions & 4 deletions sick-fits/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-styled-components": "^1.5.1",
"date-fns": "^2.0.0-alpha.7",
"downshift": "^1.31.14",
"downshift": "^2.1.4",
"graphql": "^0.13.2",
"graphql-tag": "^2.9.2",
"lodash.debounce": "^4.0.8",
Expand All @@ -32,14 +32,14 @@
"react-stripe-checkout": "^2.6.3",
"react-transition-group": "^2.3.1",
"styled-components": "^3.2.6",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"waait": "^1.0.2"
},
"devDependencies": {
"babel-jest": "^23.0.0",
"babel-plugin-module-resolver": "^3.1.1",
"casual": "^1.5.19",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.4",
"graphql-tools": "^3.0.2",
"jest": "^22.4.4",
Expand All @@ -56,7 +56,7 @@
".*": "babel-jest"
}
},
"//": "This is our babel config, I prefer this over a .babelrc file",
"//": "This is out babel config, I prefer this over a .babelrc file",
"babel": {
"env": {
"development": {
Expand Down Expand Up @@ -97,6 +97,15 @@
}
}
]
],
"plugins": [
[
"styled-components",
{
"ssr": true,
"displayName": true
}
]
]
}
}
Expand Down
57 changes: 57 additions & 0 deletions stepped-solutions/53/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: 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
}

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 093c172

Please sign in to comment.