From 14caed5d15b3601bb91a5f4a688fbdfba38cf321 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Mon, 18 Jun 2018 16:17:23 -0400 Subject: updates --- finished-application/backend/package-lock.json | 190 ++++++++++++--------- finished-application/backend/package.json | 8 +- .../backend/prisma/datamodel.graphql | 1 + .../backend/src/generated/prisma.graphql | 8 +- finished-application/backend/src/index.js | 7 +- .../backend/src/resolvers/Mutation.js | 9 +- finished-application/frontend/config.js | 2 +- 7 files changed, 133 insertions(+), 92 deletions(-) diff --git a/finished-application/backend/package-lock.json b/finished-application/backend/package-lock.json index 9a3d167..9e84a8d 100644 --- a/finished-application/backend/package-lock.json +++ b/finished-application/backend/package-lock.json @@ -4,12 +4,12 @@ "lockfileVersion": 1, "dependencies": { "@babel/code-frame": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.49.tgz", - "integrity": "sha1-vs2AVIJzREDJ0TfkbXc0DmTX9Rs=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", + "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", "dev": true, "requires": { - "@babel/highlight": "7.0.0-beta.49" + "@babel/highlight": "7.0.0-beta.51" } }, "@babel/generator": { @@ -40,9 +40,9 @@ } }, "@babel/highlight": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.49.tgz", - "integrity": "sha1-lr3GtD4TSCASumaRsQGEktOWIsw=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", + "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", "dev": true, "requires": { "chalk": "^2.0.0", @@ -51,11 +51,11 @@ } }, "@babel/runtime": { - "version": "7.0.0-beta.49", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0-beta.49.tgz", - "integrity": "sha1-A7O/B+uYIHLI6FHdLd1RECguYb8=", + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0-beta.51.tgz", + "integrity": "sha1-SLjtGDBwNMZiD2Q1FGUMoszAFlo=", "requires": { - "core-js": "^2.5.6", + "core-js": "^2.5.7", "regenerator-runtime": "^0.11.1" } }, @@ -247,9 +247,9 @@ "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==" }, "@types/node": { - "version": "10.3.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.2.tgz", - "integrity": "sha512-9NfEUDp3tgRhmoxzTpTo+lq+KIVFxZahuRX0LHF/9IzKHaWuoWsIrrJ61zw5cnnlGINX8lqJzXYfQTOICS5Q+A==" + "version": "10.3.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.3.tgz", + "integrity": "sha512-/gwCgiI2e9RzzZTKbl+am3vgNqOt7a9fJ/uxv4SqYKxenoEDNVU3KZEadlpusWhQI0A0dOrZ0T68JYKVjzmgdQ==" }, "@types/range-parser": { "version": "1.2.2", @@ -266,9 +266,9 @@ } }, "@types/zen-observable": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.5.3.tgz", - "integrity": "sha512-aDvGDAHcVfUqNmd8q4//cHAP+HGxsbChbBbuk3+kMVk5TTxfWLpQWvVN3+UPjohLnwMYN7jr6BWNn2cYNqdm7g==" + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.5.4.tgz", + "integrity": "sha512-sW6xN96wUak4tgc89d0tbTg7QDGYhGv5hvQIS6h4mRCd8h2btiZ80loPU8cyLwsBbA4ZeQt0FjvUhJ4rNhdsGg==" }, "abab": { "version": "1.0.4", @@ -292,9 +292,9 @@ } }, "acorn": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.6.2.tgz", - "integrity": "sha512-zUzo1E5dI2Ey8+82egfnttyMlMZ2y0D8xOCO3PNPPlYXpl8NZvF6Qk9L9BEtJs+43FqEmfBViDqc5d1ckRDguw==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", "dev": true }, "acorn-globals": { @@ -550,9 +550,9 @@ }, "dependencies": { "@types/node": { - "version": "9.6.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.21.tgz", - "integrity": "sha512-zQS6mHzxEstR8Vvnpc3JDUCDGWnHFzMTcBu9UCZoVLuj1Uvkkk0qFKJQEhlvbsX34m3xt12ejV09eO/ljZcn7A==" + "version": "9.6.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.22.tgz", + "integrity": "sha512-RIg9EkxzVMkNH0M4sLRngK23f5QiigJC0iODQmu4nopzstt8AjegYund3r82iMrd2BNCjcZVnklaItvKHaGfBA==" } } }, @@ -658,9 +658,12 @@ } }, "apollo-utilities": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.0.13.tgz", - "integrity": "sha512-WIbKDsFsLXMgPPGmlB2pL2noHT13TOLU2eRSyPjQMQwcz9lO9UKRkwK8pRJ8b4Zo/9qQHm30F/xlfP/OSr2ZSw==" + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.0.15.tgz", + "integrity": "sha512-74/oBQhIfWKgkwNJZoBVOLfmAZQlwUSCb4fEzd4sNFOkJL1CscmBge+YHhmTyKRQnwz0BYjWfLx4T99/jhF7CA==", + "requires": { + "fast-json-stable-stringify": "^2.0.0" + } }, "append-transform": { "version": "1.0.0", @@ -923,9 +926,9 @@ } }, "aws-sdk": { - "version": "2.254.1", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.254.1.tgz", - "integrity": "sha512-v4hrK7KYFLLRDMERmT3c7jstl5LAqH8iCz5sV9u+wvW9csYzIAQdubfjkpzVk4qN78R9J6S+VmIL9eva7pgY+w==", + "version": "2.259.1", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.259.1.tgz", + "integrity": "sha512-z2/t30caHNadSKeasUTS8trgIoHuWtmOKEhQK72Bqtbbgviqw2++sDG1Gkbj7n7yRihmg+yPNUE6i+JG3vfDrA==", "requires": { "buffer": "4.9.1", "events": "1.1.1", @@ -2076,9 +2079,9 @@ "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" }, "caniuse-lite": { - "version": "1.0.30000851", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000851.tgz", - "integrity": "sha512-Y1ecA1cL9wg0vni8t33nBw/poX8ypm+2c3fbwAESj8cm4ufK9CBFQ1+nUK8Dp5dtFo5Fc3JzkI5DKmQbuIo6hQ==", + "version": "1.0.30000856", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000856.tgz", + "integrity": "sha512-x3mYcApHMQemyaHuH/RyqtKCGIYTgEA63fdi+VBvDz8xUSmRiVWTLeyKcoGQCGG6UPR9/+4qG4OKrTa6aSQRKg==", "dev": true }, "capture-exit": { @@ -2187,23 +2190,24 @@ } }, "chokidar": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz", - "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", + "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", "dev": true, "requires": { "anymatch": "^2.0.0", "async-each": "^1.0.0", "braces": "^2.3.0", - "fsevents": "^1.1.2", + "fsevents": "^1.2.2", "glob-parent": "^3.1.0", "inherits": "^2.0.1", "is-binary-path": "^1.0.0", "is-glob": "^4.0.0", + "lodash.debounce": "^4.0.8", "normalize-path": "^2.1.1", "path-is-absolute": "^1.0.0", "readdirp": "^2.0.0", - "upath": "^1.0.0" + "upath": "^1.0.5" }, "dependencies": { "glob-parent": { @@ -2347,17 +2351,17 @@ } }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", + "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", "requires": { - "color-name": "^1.1.1" + "color-name": "1.1.1" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=" }, "colors": { "version": "1.0.3", @@ -3783,8 +3787,7 @@ "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, "fast-levenshtein": { "version": "2.0.6", @@ -3838,9 +3841,9 @@ "dev": true }, "filenamify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-2.0.0.tgz", - "integrity": "sha1-vRYiYsC26Uv7zc8Zo7uzdk94VpU=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-2.1.0.tgz", + "integrity": "sha512-ICw7NTT6RsDp2rnYKVd8Fu4cr6ITzGy3+u4vUujPkabyaz+03F24NWEX7fs5fp+kBonlaqPH8fAO2NM+SXt/JA==", "dev": true, "requires": { "filename-reserved-regex": "^2.0.0", @@ -4793,9 +4796,9 @@ } }, "graphql-binding": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/graphql-binding/-/graphql-binding-2.1.0.tgz", - "integrity": "sha512-8kSOrR9IOtu2ZglUUiSnrgC8TkiULKo3IROhZbnlCp6KKZIVNogd080ph50naaYKCVt8pk0L0tHx7ro7MB2BMQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/graphql-binding/-/graphql-binding-2.1.1.tgz", + "integrity": "sha512-Bx70DaG0LVUKIle0N5anQ97T9bIq6RfUsPB5wa10vYbytp0kscLoh9pMlVtxtQ6KwrfkRp1QhV8pa2fMHxBeLw==", "requires": { "graphql-import": "^0.5.2", "graphql-tools": "3.0.1", @@ -4829,9 +4832,9 @@ } }, "graphql-cli": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/graphql-cli/-/graphql-cli-2.16.2.tgz", - "integrity": "sha512-qSyUQ54+FDlJXDosxB0wpVHKXLA7icvLZ4wBWiyADfl0bvOugH3cqWnOC7P+AGUKE12jW2Yav+SdiQtQTthfKQ==", + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/graphql-cli/-/graphql-cli-2.16.3.tgz", + "integrity": "sha512-mpAUpGPtYefyN9X+ApLjCSYqaELIUzf4Xej7VMc57T0XQ7LheSKM7OrO0ezcwBfMky6xgppQK2N3Of6KMN9rXw==", "dev": true, "requires": { "adm-zip": "0.4.7", @@ -5195,9 +5198,9 @@ } }, "graphql-yoga": { - "version": "1.14.7", - "resolved": "https://registry.npmjs.org/graphql-yoga/-/graphql-yoga-1.14.7.tgz", - "integrity": "sha512-Fi+X/6XV5Pxhc3MWNT7wxm6FmKoD61j3BLUHaLeGvX2hFKyAOpjuvvWWaqs2N68ywwHheTz8bFW9uwCMpLlOjA==", + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/graphql-yoga/-/graphql-yoga-1.14.8.tgz", + "integrity": "sha512-bctEzmhbrhmtJFePc9dfE01W9OsFBM3ujnUsz3Sa7VccJDFhUloaDrpCfWH++tbTVwt/1FCBzXp6vrUNvKJ9WA==", "requires": { "@types/cors": "^2.8.4", "@types/express": "^4.11.1", @@ -6805,6 +6808,12 @@ "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, "lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", @@ -7469,9 +7478,9 @@ "dev": true }, "nodemailer": { - "version": "4.6.6", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.6.6.tgz", - "integrity": "sha512-sIcM/Do0XBJmu7ruENLoR+4TCk0B4C1ftqRjWrVeoez9Dt23SmL9bXKqswVqyxuT/RdK8TKWciZvxHykerXCRw==" + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.6.7.tgz", + "integrity": "sha512-GIAAYvs9XIP1fBa8wR89ukUh3yjL44pom5LKY5nTZcL+Zp9sRkqL8wgskyBQECQg9CPsDX/fjTZx8MNz20t0jA==" }, "nodemon": { "version": "1.17.5", @@ -7628,9 +7637,9 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "nwsapi": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.3.tgz", - "integrity": "sha512-zFJF9lOpg2+uicP0BQKOAfIOqeTp/p8PC669mewxgRkR1hGjne8BMUHk4wpRS9o5Z0icA5Nv04HmGkW31KfMKw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.4.tgz", + "integrity": "sha512-Zt6HRR6RcJkuj5/N9zeE7FN6YitRW//hK2wTOwX274IBphbY3Zf5+yn5mZ9v/SzAOTMjQNxZf9KkmPLWn0cV4g==", "dev": true }, "oauth-sign": { @@ -8275,19 +8284,19 @@ } }, "prisma-binding": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/prisma-binding/-/prisma-binding-2.0.2.tgz", - "integrity": "sha512-5G/4qs7BJUAe8g4aqj5wxrFB1tkopih9Gp65GKwlJyxDqFG/cw4GuYjgfgM8RnEEu94WaftUVWPT77EmMzcf0A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/prisma-binding/-/prisma-binding-2.1.0.tgz", + "integrity": "sha512-8gH9r/G6vT9A3tWdacRJ0LjRGMP8gxRQJIl4pC4X0OIpbk1xfuPYaw6/TE5nml0hLDvkNEv5t0CIOrjClYZ8+w==", "requires": { "apollo-link": "1.2.2", "apollo-link-error": "1.0.9", "apollo-link-ws": "1.0.8", "cross-fetch": "2.1.1", - "graphql-binding": "2", + "graphql-binding": "2.1.1", "graphql-import": "0.5.2", "graphql-tools": "3.0.1", "http-link-dataloader": "^0.1.2", - "jsonwebtoken": "^8.2.1", + "jsonwebtoken": "8.2.1", "subscriptions-transport-ws": "0.9.8" }, "dependencies": { @@ -8297,9 +8306,9 @@ "integrity": "sha512-wXAVyLfkG1UMkKOdMijVWFky39+OD/41KftzqfX1Oejd0Gm6dOIKjCihSVECg6X7PHjftxXmfOKA/d1H79ZfvQ==" }, "@types/node": { - "version": "9.6.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.21.tgz", - "integrity": "sha512-zQS6mHzxEstR8Vvnpc3JDUCDGWnHFzMTcBu9UCZoVLuj1Uvkkk0qFKJQEhlvbsX34m3xt12ejV09eO/ljZcn7A==" + "version": "9.6.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.22.tgz", + "integrity": "sha512-RIg9EkxzVMkNH0M4sLRngK23f5QiigJC0iODQmu4nopzstt8AjegYund3r82iMrd2BNCjcZVnklaItvKHaGfBA==" }, "apollo-link": { "version": "1.2.2", @@ -8357,6 +8366,28 @@ } } }, + "jsonwebtoken": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.2.1.tgz", + "integrity": "sha512-l8rUBr0fqYYwPc8/ZGrue7GiW7vWdZtZqelxo4Sd5lMvuEeCK8/wS54sEo6tJhdZ6hqfutsj6COgC0d1XdbHGw==", + "requires": { + "jws": "^3.1.4", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "xtend": "^4.0.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, "node-fetch": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", @@ -10177,9 +10208,9 @@ } }, "subscriptions-transport-ws": { - "version": "0.9.10", - "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.10.tgz", - "integrity": "sha1-uNP6n+Pne4dNXmJa0qVDlBefDvw=", + "version": "0.9.11", + "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.11.tgz", + "integrity": "sha512-B8fwTIJy2buUcBXM6Ffbax30XcEqvCqL8RXwbivBAiB3X9ezrTcF5nYMmNGZ47sxrDYA1XfQ5W3aTgJEm8BFJA==", "requires": { "backo2": "^1.0.2", "eventemitter3": "^3.1.0", @@ -10650,9 +10681,9 @@ "dev": true }, "ts-node": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.1.0.tgz", - "integrity": "sha512-mw11Bq08RZgrU/bzcVw/Ti9wNyefpOanXgWsHg008wyVHjvFhWxNatVVrciOAu8BcWSECoNOSunRzUokKH8Mmw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.1.1.tgz", + "integrity": "sha512-79FnymLGDBd/nXoiak1L6w6fd9Zz9Ge/x8/Aglaeh31KkqRLDzbfT1vBGlO5dqc76WzufTlW4IYl7e01CVUF5A==", "requires": { "arrify": "^1.0.0", "diff": "^3.1.0", @@ -11311,8 +11342,7 @@ "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" }, "y18n": { "version": "3.2.1", diff --git a/finished-application/backend/package.json b/finished-application/backend/package.json index e038404..abe715a 100644 --- a/finished-application/backend/package.json +++ b/finished-application/backend/package.json @@ -12,17 +12,17 @@ "bcryptjs": "2.4.3", "cookie-parser": "^1.4.3", "graphql": "^0.13.2", - "graphql-yoga": "1.14.7", + "graphql-yoga": "1.14.8", "jsonwebtoken": "8.3.0", - "nodemailer": "^4.6.6", + "nodemailer": "^4.6.7", "npm-run-all": "^4.1.3", - "prisma-binding": "2.0.2", + "prisma-binding": "2.1.0", "stripe": "^6.1.1" }, "devDependencies": { "babel-preset-env": "^1.7.0", "dotenv": "6.0.0", - "graphql-cli": "^2.16.2", + "graphql-cli": "^2.16.3", "jest-cli": "^23.1.0", "nodemon": "1.17.5", "prisma": "1.9.0" diff --git a/finished-application/backend/prisma/datamodel.graphql b/finished-application/backend/prisma/datamodel.graphql index cb8afcb..d652dc4 100644 --- a/finished-application/backend/prisma/datamodel.graphql +++ b/finished-application/backend/prisma/datamodel.graphql @@ -52,6 +52,7 @@ type OrderItem { createdAt: DateTime! updatedAt: DateTime! quantity: Int! @default(value: 1) + user: User } type Order { diff --git a/finished-application/backend/src/generated/prisma.graphql b/finished-application/backend/src/generated/prisma.graphql index 953ddc2..b607520 100644 --- a/finished-application/backend/src/generated/prisma.graphql +++ b/finished-application/backend/src/generated/prisma.graphql @@ -1,5 +1,5 @@ # source: https://us1.prisma.sh/wesbos/sick-fits/dev -# timestamp: Fri May 25 2018 10:46:45 GMT-0400 (EDT) +# timestamp: Mon Jun 18 2018 16:08:08 GMT-0400 (EDT) type AggregateCartItem { count: Int! @@ -819,6 +819,7 @@ type OrderItem implements Node { createdAt: DateTime! updatedAt: DateTime! quantity: Int! + user(where: UserWhereInput): User } """A connection to a list of items.""" @@ -838,6 +839,7 @@ input OrderItemCreateInput { largeImage: String price: Int! quantity: Int + user: UserCreateOneInput } input OrderItemCreateManyInput { @@ -933,6 +935,7 @@ input OrderItemUpdateDataInput { largeImage: String price: Int quantity: Int + user: UserUpdateOneInput } input OrderItemUpdateInput { @@ -942,6 +945,7 @@ input OrderItemUpdateInput { largeImage: String price: Int quantity: Int + user: UserUpdateOneInput } input OrderItemUpdateManyInput { @@ -1261,6 +1265,7 @@ input OrderItemWhereInput { """All values greater than or equal the given value.""" quantity_gte: Int + user: UserWhereInput } input OrderItemWhereUniqueInput { @@ -1759,6 +1764,7 @@ input UserUpdateInput { input UserUpdateOneInput { create: UserCreateInput connect: UserWhereUniqueInput + disconnect: Boolean delete: Boolean update: UserUpdateDataInput upsert: UserUpsertNestedInput diff --git a/finished-application/backend/src/index.js b/finished-application/backend/src/index.js index 94911ec..2a1b433 100644 --- a/finished-application/backend/src/index.js +++ b/finished-application/backend/src/index.js @@ -22,7 +22,10 @@ server.express.use((req, res, next) => { // 2. Get User from their ID server.express.use(async (req, res, next) => { if (!req.userId) return next(); - const user = await db.query.user({ where: { id: req.userId } }, `{ id, permissions, email, name }`); + const user = await db.query.user( + { where: { id: req.userId } }, + `{ id, permissions, email, name }` + ); req.user = user; next(); }); @@ -33,7 +36,7 @@ server.start( credentials: true, origin: process.env.FRONTEND_URL, }, - port: 4444, + port: process.env.PORT, }, deets => { console.log(`Server is running on http://localhost:${deets.port}`); diff --git a/finished-application/backend/src/resolvers/Mutation.js b/finished-application/backend/src/resolvers/Mutation.js index 0f1d9ba..80ff3f2 100644 --- a/finished-application/backend/src/resolvers/Mutation.js +++ b/finished-application/backend/src/resolvers/Mutation.js @@ -276,14 +276,15 @@ const mutations = { // 3. convert the items they want to OrderItems const orderItems = user.cart.map(cartItem => { + console.log(cartItem); const orderItem = { quantity: cartItem.quantity, // copy all the item details so it's there forever ...cartItem.item, - item: { - // relationship to the Item incase we need it - connect: { id: cartItem.item.id }, - }, + // item: { + // // relationship to the Item incase we need it + // connect: { id: cartItem.item.id }, + // }, user: { connect: { id: user.id } }, }; // scrub the ID from it because the orderItem will have it's own ID diff --git a/finished-application/frontend/config.js b/finished-application/frontend/config.js index f5f234a..53e05ed 100644 --- a/finished-application/frontend/config.js +++ b/finished-application/frontend/config.js @@ -1,3 +1,3 @@ // This is client side config only - don't put anything in here that shouldn't be public! -export const endpoint = `http://localhost:4444`; +export const endpoint = `http://localhost:5555`; export const perPage = 4; -- cgit v1.3