Skip to content

Commit

Permalink
Task_5_Done
Browse files Browse the repository at this point in the history
  • Loading branch information
peteyycz committed Sep 22, 2019
1 parent cce8655 commit 7336c75
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 19 deletions.
141 changes: 126 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon -r dotenv/config src/server.js",
"start": "nodemon -r dotenv/config src/server",
"lint": "eslint --ignore-path .gitignore ."
},
"husky": {
Expand All @@ -24,15 +24,18 @@
},
"homepage": "https://github.com/RisingStack/jsconfbp-2019-graphql#readme",
"dependencies": {
"apollo-link-http": "1.5.16",
"axios": "0.19.0",
"bcrypt": "^3.0.6",
"cors": "^2.8.5",
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"graphql": "^14.5.4",
"graphql-tools": "4.0.5",
"helmet": "^3.21.0",
"knex": "^0.19.3",
"lodash": "^4.17.15",
"node-fetch": "2.6.0",
"pg": "^7.12.1",
"uuidv4": "^5.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/createTestData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

require('dotenv/config');

const db = require('../src/db');
const db = require('../src/server/db');

Promise.all(db.createTables()).then(() => {
Promise.all(db.createTestData()).then(() => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/dropTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

require('dotenv/config');

const db = require('../src/db');
const db = require('../src/server/db');

Promise.all(db.dropTables()).then(() => {
console.log('Tables dropped.');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion src/server.js → src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const express = require('express');
const graphqlHTTP = require('express-graphql');
const helmet = require('helmet');
const cors = require('cors');
const { mergeSchemas } = require('graphql-tools');
const pokemonSchema = require('./pokemonSchema');

const db = require('./db');

Expand All @@ -25,7 +27,9 @@ app.use(cors({
}));

app.use('/graphql', graphqlHTTP(async () => ({
schema,
schema: mergeSchemas({
schemas: [schema, await pokemonSchema()],
}),
// rootValue,
graphiql: true,
customFormatErrorFn: (error) => {
Expand Down
Loading

0 comments on commit 7336c75

Please sign in to comment.