summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-04-13 10:14:04 -0400
committerWes Bos <wesbos@gmail.com>2018-04-13 10:14:04 -0400
commitcabc86b83951b9fefb7e864fba82f1d93715c805 (patch)
tree26795af6522c07f68cfaea66a7e88965e0480cf0
parent97b6de6aa437f7a913a33b9e6aa18a919faf2caf (diff)
variables
-rw-r--r--backend/.gitignore2
-rw-r--r--backend/README.md6
-rw-r--r--backend/src/createServer.js4
-rw-r--r--frontend/config.js3
-rw-r--r--frontend/pages/diagram.js20
-rw-r--r--frontend/queries/index.js3
6 files changed, 20 insertions, 18 deletions
diff --git a/backend/.gitignore b/backend/.gitignore
index 2a907ab..2ad89a8 100644
--- a/backend/.gitignore
+++ b/backend/.gitignore
@@ -4,5 +4,5 @@ node_modules
.idea
.vscode
*.log
-.env*
+*.env*
!.env-sample
diff --git a/backend/README.md b/backend/README.md
index 2aab87c..56c5b9c 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -30,9 +30,3 @@ if in trouble, run `prisma local nuke`
1. go to your settings and turn on unsigned uploading
2.
-
-
-## TODO:
-1. When an item is deleted, the cartItems need to be deleted as well
-1. When an order goes through, delete cartItems
-
diff --git a/backend/src/createServer.js b/backend/src/createServer.js
index 57518b2..df016a7 100644
--- a/backend/src/createServer.js
+++ b/backend/src/createServer.js
@@ -1,6 +1,8 @@
const { GraphQLServer } = require('graphql-yoga');
const { Prisma } = require('prisma-binding');
-require('dotenv').config();
+require('dotenv').config({ path: 'variables.env' });
+
+console.log(process.env.PRISMA_STAGE);
const Mutation = require('./resolvers/Mutation');
const Query = require('./resolvers/Query');
diff --git a/frontend/config.js b/frontend/config.js
index d2cb33c..f5f234a 100644
--- a/frontend/config.js
+++ b/frontend/config.js
@@ -1,4 +1,3 @@
// This is client side config only - don't put anything in here that shouldn't be public!
-export const projectId = `cj99zm6ye06sb01325ic751ww`;
export const endpoint = `http://localhost:4444`;
-export const perPage = 2;
+export const perPage = 4;
diff --git a/frontend/pages/diagram.js b/frontend/pages/diagram.js
index f7e9a7a..a5ad1f7 100644
--- a/frontend/pages/diagram.js
+++ b/frontend/pages/diagram.js
@@ -6,6 +6,10 @@ const DiagramStyles = styled.div`
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-column-gap: 20px;
+ h1 {
+ grid-column: 1 / -1;
+ grid-row: 1;
+ }
ul {
margin: 0;
padding: 0;
@@ -33,7 +37,7 @@ const DiagramStyles = styled.div`
padding: 20px;
min-height: 500px;
grid-column: span 2;
- grid-row: 3;
+ grid-row: 4;
line-height: 1.7;
}
@@ -41,20 +45,21 @@ const DiagramStyles = styled.div`
grid-column: span 4;
background: red;
padding: 5px;
+ grid-row: 2;
text-align: center;
color: white;
text-transform: uppercase;
}
.arrow {
- font-size: 50px;
+ font-size: 30px;
line-height: 1;
transform: translateX(-10px) translateX(-50%);
text-align: center;
- grid-row: 2;
+ grid-row: 3;
margin-bottom: -100%;
background: white;
- height: 60px;
+ height: 40px;
}
.arrow1 {
grid-column: 3;
@@ -80,8 +85,9 @@ const DiagramStyles = styled.div`
const Diagram = () => (
<DiagramStyles>
+ <h1>The Pieces of our Application</h1>
<span className="location frontend">Frontend</span>
- <span className="location backend">Backend</span>
+ <span className=" location backend">Backend</span>
<div className="slat slat1">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/640px-React-icon.svg.png"
@@ -135,7 +141,7 @@ const Diagram = () => (
src="https://camo.githubusercontent.com/389368863d9b9df25acd07644bad7642459c3533/68747470733a2f2f696d6775722e636f6d2f5376366a3042362e706e67"
alt="React.js"
/>
- <h2>YOGA Server</h2>
+ <h2>GraphQL Yoga</h2>
<span className="for">An Express GraphQL Server For:</span>
<ul>
@@ -165,7 +171,7 @@ const Diagram = () => (
src="https://camo.githubusercontent.com/87336b0d10b0d1f27518e14c4a36f995babd6a2f/68747470733a2f2f696d6775722e636f6d2f485575313072482e706e67"
alt="React.js"
/>
- <h2>Prisma Server</h2>
+ <h2>Prisma</h2>
<span className="for">A GraphQL Database Interface</span>
<ul>
diff --git a/frontend/queries/index.js b/frontend/queries/index.js
index 26eae35..f4442b1 100644
--- a/frontend/queries/index.js
+++ b/frontend/queries/index.js
@@ -1,5 +1,6 @@
import gql from 'graphql-tag';
import { itemDetails } from './fragments';
+import { perPage } from '../config';
export const CREATE_ITEM_MUTATION = gql`
${itemDetails}
@@ -74,7 +75,7 @@ export const CREATE_ORDER_MUTATION = gql`
export const ALL_ITEMS_QUERY = gql`
# Import the Fragment
${itemDetails}
- query AllItemsQuery($skip: Int = 0, $first: Int = 2) {
+ query AllItemsQuery($skip: Int = 0, $first: Int = ${perPage}) {
itemsConnection(orderBy: createdAt_DESC, first: $first, skip: $skip) @connection(key: "itemsConnection") {
aggregate {
count