Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions example/apollo-server/authScopes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import { ApolloServer } from 'apollo-server';
import neo4j from 'neo4j-driver';

// JWT
// eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJzY29wZXMiOlsicmVhZDp1c2VyIiwiY3JlYXRlOnVzZXIiXX0.jCidMhYKk_0s8aQpXojYwZYz00eIG9lD_DbeXRKj4vA

// scopes
// "scopes": ["read:user", "create:user"]

// JWT_SECRET
// oqldBPU1yMXcrTwcha1a9PGi9RHlPVzQ

const typeDefs = `
type User {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neo4j-graphql-js",
"version": "2.19.1",
"name": "@cognite/neo4j-graphql-js",
"version": "2.19.3",
"description": "A GraphQL to Cypher query execution layer for Neo4j. ",
"main": "./dist/index.js",
"scripts": {
Expand Down Expand Up @@ -36,7 +36,7 @@
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/neo4j-graphql/neo4j-graphql-js"
"url": "git+https://github.com/neo4j-graphql/neo4j-graphql-js.git"
},
"devDependencies": {
"@apollo/federation": "^0.20.7",
Expand Down Expand Up @@ -94,5 +94,13 @@
"prettier --write",
"git add"
]
},
"bugs": {
"url": "https://github.com/neo4j-graphql/neo4j-graphql-js/issues"
},
"homepage": "https://github.com/neo4j-graphql/neo4j-graphql-js#readme",
"directories": {
"example": "example",
"test": "test"
}
}
14 changes: 10 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,12 @@ export const assertSchema = ({
driver,
schema,
dropExisting = true,
debug = false
debug = false,
sessionParams = {}
}) => {
const statement = schemaAssert({ schema, dropExisting });
const executeQuery = driver => {
const session = driver.session();
const session = driver.session(sessionParams);
return session
.writeTransaction(tx =>
tx.run(statement).then(result => {
Expand All @@ -341,8 +342,13 @@ export const assertSchema = ({
});
};

export const searchSchema = async ({ driver, schema, debug = false }) => {
const session = driver.session();
export const searchSchema = async ({
driver,
schema,
debug = false,
sessionParams = {}
}) => {
const session = driver.session(sessionParams);
// drop all search indexes, given they cannot be updated via a second CALL to createNodeIndex
const dropStatement = `
CALL db.indexes() YIELD name, provider WHERE provider = "fulltext-1.0"
Expand Down