diff --git a/package.json b/package.json index 5636e1283..9d83da85b 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,10 @@ }, "author": "Human Connection gGmbH", "license": "MIT", + "jest": { + "verbose": true, + "testMatch": ["**/src/**/?(*.)+(spec|test).js?(x)" ] + }, "dependencies": { "apollo-cache-inmemory": "~1.3.11", "apollo-client": "~2.4.8", @@ -46,7 +50,7 @@ "lodash": "~4.17.11", "ms": "~2.1.1", "neo4j-driver": "~1.7.2", - "neo4j-graphql-js": "~2.1.1", + "neo4j-graphql-js": "~2.2.0", "node-fetch": "~2.3.0", "npm-run-all": "~4.1.5", "passport": "~0.4.0", diff --git a/src/graphql-schema.js b/src/graphql-schema.js index 9cee7ad51..95a62cb99 100644 --- a/src/graphql-schema.js +++ b/src/graphql-schema.js @@ -102,7 +102,6 @@ export const resolvers = { .then(async (result) => { session.close() const [currentUser] = await result.records.map(function (record) { - console.log(record.get('user')) return record.get('user') }) if (currentUser && await bcrypt.compareSync(password, currentUser.password)) { diff --git a/src/graphql-schema.test.js b/src/graphql-schema.test.js index 4956c3ab0..a58fb3599 100644 --- a/src/graphql-schema.test.js +++ b/src/graphql-schema.test.js @@ -19,7 +19,7 @@ afterEach(async () => { await app.close() }) -describe.only('login', () => { +describe('login', () => { const mutation = (params) => { const { email, password } = params return ` diff --git a/src/seed/data/index.js b/src/seed/data/index.js index e66342fe3..e50fececc 100644 --- a/src/seed/data/index.js +++ b/src/seed/data/index.js @@ -36,5 +36,5 @@ export default async function (client) { } }) /* eslint-disable-next-line no-console */ - console.log('Seeded Data', data) + console.log('Seeded Data...') } diff --git a/src/server.js b/src/server.js index 860a4f8c4..f10696f16 100644 --- a/src/server.js +++ b/src/server.js @@ -21,6 +21,7 @@ let schema = makeExecutableSchema({ }) const driver = neo4j().getDriver() +const debug = process.env.NODE_ENV !== 'production' && process.env.DEBUG === 'true' schema = augmentSchema(schema, { query: { @@ -28,7 +29,8 @@ schema = augmentSchema(schema, { }, mutation: { exclude: ['Statistics', 'LoggedInUser'] - } + }, + debug: debug }) schema = applyScalars(applyDirectives(schema)) @@ -50,7 +52,7 @@ const createServer = (options) => { return payload }, schema: schema, - tracing: true, + tracing: debug, middlewares: middleware(schema), mocks: (process.env.MOCK === 'true') ? mocks : false } diff --git a/yarn.lock b/yarn.lock index 1d861e0e6..ee9b4a0df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5393,10 +5393,10 @@ neo4j-driver@^1.7.2, neo4j-driver@~1.7.2: text-encoding "^0.6.4" uri-js "^4.2.1" -neo4j-graphql-js@~2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/neo4j-graphql-js/-/neo4j-graphql-js-2.1.1.tgz#bdb1af2fb45d1058492852ed9307586f6deab37d" - integrity sha512-OcDaFIfOKZF02jmxnWWTLQr64mu79RGAtDULfciwElW59GjRF425M2Yf4gLJuQFscnh7d+Qk/+Ng+jVbz+V4lA== +neo4j-graphql-js@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/neo4j-graphql-js/-/neo4j-graphql-js-2.2.0.tgz#f0d934b376e9476ef2aa1600e86eb1f8a74c10a2" + integrity sha512-DyYRE6wAVPKxDAHkRwiZmNYx+Vv3KVFQp2Ul1Ay4f2ahW52mWzwMFe/Rlbau3phFYSZZAeaRCT7XLBy++sg/cQ== dependencies: graphql "^14.0.2" lodash "^4.17.11"