mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Upgraded graphql from 0.13.0 to 14.1.1
This commit is contained in:
parent
13c67437d8
commit
ae9ebcc3ab
@ -15,9 +15,9 @@
|
|||||||
"test": "nyc --reporter=text-lcov yarn run test:jest",
|
"test": "nyc --reporter=text-lcov yarn run test:jest",
|
||||||
"test:before:server": "cross-env GRAPHQL_URI=http://localhost:4123 GRAPHQL_PORT=4123 babel-node src/ 2> /dev/null",
|
"test:before:server": "cross-env GRAPHQL_URI=http://localhost:4123 GRAPHQL_PORT=4123 babel-node src/ 2> /dev/null",
|
||||||
"test:before:seeder": "cross-env GRAPHQL_URI=http://localhost:4001 GRAPHQL_PORT=4001 PERMISSIONS=disabled babel-node src/ 2> /dev/null",
|
"test:before:seeder": "cross-env GRAPHQL_URI=http://localhost:4001 GRAPHQL_PORT=4001 PERMISSIONS=disabled babel-node src/ 2> /dev/null",
|
||||||
"test:jest:cmd": "wait-on tcp:4001 tcp:4123 && jest --forceExit --detectOpenHandles --runInBand",
|
"test:jest:cmd": "wait-on tcp:4001 tcp:4123 && jest --forceExit --detectOpenHandles --runInBand",
|
||||||
"test:jest:cmd:debug": "wait-on tcp:4001 tcp:4123 && node --inspect-brk ./node_modules/.bin/jest -i --forceExit --detectOpenHandles --runInBand",
|
"test:jest:cmd:debug": "wait-on tcp:4001 tcp:4123 && node --inspect-brk ./node_modules/.bin/jest -i --forceExit --detectOpenHandles --runInBand",
|
||||||
"test:jest": "run-p --race test:before:* 'test:jest:cmd {@}' --",
|
"test:jest": "run-p --race test:before:* 'test:jest:cmd {@}' --",
|
||||||
"test:jest:debug": "run-p --race test:before:* 'test:jest:cmd:debug {@}' --",
|
"test:jest:debug": "run-p --race test:before:* 'test:jest:cmd:debug {@}' --",
|
||||||
"test:coverage": "nyc report --reporter=text-lcov > coverage.lcov",
|
"test:coverage": "nyc report --reporter=text-lcov > coverage.lcov",
|
||||||
"db:script:seed": "wait-on tcp:4001 && babel-node src/seed/seed-db.js",
|
"db:script:seed": "wait-on tcp:4001 && babel-node src/seed/seed-db.js",
|
||||||
@ -44,7 +44,7 @@
|
|||||||
"date-fns": "^2.0.0-alpha.26",
|
"date-fns": "^2.0.0-alpha.26",
|
||||||
"dotenv": "~6.2.0",
|
"dotenv": "~6.2.0",
|
||||||
"faker": "~4.1.0",
|
"faker": "~4.1.0",
|
||||||
"graphql": "~0.13.0",
|
"graphql": "~14.1.1",
|
||||||
"graphql-custom-directives": "~0.2.14",
|
"graphql-custom-directives": "~0.2.14",
|
||||||
"graphql-iso-date": "~3.6.1",
|
"graphql-iso-date": "~3.6.1",
|
||||||
"graphql-middleware": "~1.7.8",
|
"graphql-middleware": "~1.7.8",
|
||||||
|
|||||||
@ -66,15 +66,15 @@ export const resolvers = {
|
|||||||
countShouts: 'MATCH (:User)-[r:SHOUTED]->(:Post) RETURN COUNT(r) AS countShouts'
|
countShouts: 'MATCH (:User)-[r:SHOUTED]->(:Post) RETURN COUNT(r) AS countShouts'
|
||||||
}
|
}
|
||||||
let data = {
|
let data = {
|
||||||
countUsers: (await queryOne(queries.countUsers, session)).countUsers,
|
countUsers: (await queryOne(queries.countUsers, session)).countUsers.low,
|
||||||
countPosts: (await queryOne(queries.countPosts, session)).countPosts,
|
countPosts: (await queryOne(queries.countPosts, session)).countPosts.low,
|
||||||
countComments: (await queryOne(queries.countComments, session)).countComments,
|
countComments: (await queryOne(queries.countComments, session)).countComments.low,
|
||||||
countNotifications: (await queryOne(queries.countNotifications, session)).countNotifications,
|
countNotifications: (await queryOne(queries.countNotifications, session)).countNotifications.low,
|
||||||
countOrganizations: (await queryOne(queries.countOrganizations, session)).countOrganizations,
|
countOrganizations: (await queryOne(queries.countOrganizations, session)).countOrganizations.low,
|
||||||
countProjects: (await queryOne(queries.countProjects, session)).countProjects,
|
countProjects: (await queryOne(queries.countProjects, session)).countProjects.low,
|
||||||
countInvites: (await queryOne(queries.countInvites, session)).countInvites,
|
countInvites: (await queryOne(queries.countInvites, session)).countInvites.low,
|
||||||
countFollows: (await queryOne(queries.countFollows, session)).countFollows,
|
countFollows: (await queryOne(queries.countFollows, session)).countFollows.low,
|
||||||
countShouts: (await queryOne(queries.countShouts, session)).countShouts
|
countShouts: (await queryOne(queries.countShouts, session)).countShouts.low
|
||||||
}
|
}
|
||||||
resolve(data)
|
resolve(data)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { GraphQLServer } from 'graphql-yoga'
|
import { GraphQLServer } from 'graphql-yoga'
|
||||||
import { makeExecutableSchema } from 'apollo-server'
|
import { makeExecutableSchema } from 'apollo-server'
|
||||||
import { augmentSchema } from 'neo4j-graphql-js'
|
import { augmentSchema, makeAugmentedSchema } from 'neo4j-graphql-js'
|
||||||
import { typeDefs, resolvers } from './graphql-schema'
|
import { typeDefs, resolvers } from './graphql-schema'
|
||||||
import express from 'express'
|
import express from 'express'
|
||||||
import dotenv from 'dotenv'
|
import dotenv from 'dotenv'
|
||||||
@ -23,22 +23,21 @@ requiredEnvVars.forEach(env => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let schema = makeExecutableSchema({
|
|
||||||
typeDefs,
|
|
||||||
resolvers
|
|
||||||
})
|
|
||||||
|
|
||||||
const driver = neo4j().getDriver()
|
const driver = neo4j().getDriver()
|
||||||
const debug = process.env.NODE_ENV !== 'production' && process.env.DEBUG === 'true'
|
const debug = process.env.NODE_ENV !== 'production' && process.env.DEBUG === 'true'
|
||||||
|
|
||||||
schema = augmentSchema(schema, {
|
let schema = makeAugmentedSchema({
|
||||||
query: {
|
typeDefs,
|
||||||
exclude: ['Statistics', 'LoggedInUser']
|
resolvers,
|
||||||
},
|
config: {
|
||||||
mutation: {
|
query: {
|
||||||
exclude: ['Statistics', 'LoggedInUser']
|
exclude: ['Statistics', 'LoggedInUser']
|
||||||
},
|
},
|
||||||
debug: debug
|
mutation: {
|
||||||
|
exclude: ['Statistics', 'LoggedInUser']
|
||||||
|
},
|
||||||
|
debug: debug
|
||||||
|
}
|
||||||
})
|
})
|
||||||
schema = applyScalars(applyDirectives(schema))
|
schema = applyScalars(applyDirectives(schema))
|
||||||
|
|
||||||
|
|||||||
10
yarn.lock
10
yarn.lock
@ -3597,12 +3597,12 @@ graphql-yoga@~1.17.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
iterall "^1.2.2"
|
iterall "^1.2.2"
|
||||||
|
|
||||||
graphql@~0.13.0:
|
graphql@~14.1.1:
|
||||||
version "0.13.2"
|
version "14.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.13.2.tgz#4c740ae3c222823e7004096f832e7b93b2108270"
|
resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.1.1.tgz#d5d77df4b19ef41538d7215d1e7a28834619fac0"
|
||||||
integrity sha512-QZ5BL8ZO/B20VA8APauGBg3GyEgZ19eduvpLWoq5x7gMmWnHoy8rlQWPLmWgFvo1yNgjSEFMesmS4R6pPr7xog==
|
integrity sha512-C5zDzLqvfPAgTtP8AUPIt9keDabrdRAqSWjj2OPRKrKxI9Fb65I36s1uCs1UUBFnSWTdO7hyHi7z1ZbwKMKF6Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
iterall "^1.2.1"
|
iterall "^1.2.2"
|
||||||
|
|
||||||
growly@^1.3.0:
|
growly@^1.3.0:
|
||||||
version "1.3.0"
|
version "1.3.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user