@rxdi/neo4j 0.7.151 → 0.7.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ const mapToString = (a) => a.map(t => t.toString());
15
15
  exports.mapToString = mapToString;
16
16
  const exclude = (c, type, defaultExcludedTypes) => ({
17
17
  [type]: {
18
- exclude: defaultExcludedTypes.concat(...c.excludedTypes[type].exclude)
18
+ exclude: defaultExcludedTypes.concat(...c.excludedTypes[type]['exclude'])
19
19
  }
20
20
  });
21
21
  exports.exclude = exclude;
@@ -1,6 +1,7 @@
1
1
  import { InjectionToken } from '@rxdi/core';
2
2
  import { GraphQLObjectType, GraphQLSchema } from 'graphql';
3
3
  import { ResponseToolkit } from 'hapi';
4
+ import { AugmentSchemaConfig } from 'neo4j-graphql-js';
4
5
  export declare const Neo4JTypes: InjectionToken<GraphQLObjectType<any, any, {
5
6
  [key: string]: any;
6
7
  }>[]>;
@@ -34,7 +35,7 @@ export interface NEO4J_MODULE_CONFIG {
34
35
  username?: string;
35
36
  password?: string;
36
37
  address?: string | 'bolt://localhost:7687';
37
- excludedTypes?: ExcludedTypes;
38
+ excludedTypes?: AugmentSchemaConfig;
38
39
  debug?: boolean;
39
40
  auth?: boolean;
40
41
  context?: any;
@@ -44,4 +45,4 @@ export interface NEO4J_MODULE_CONFIG {
44
45
  export declare const NEO4J_DRIVER: InjectionToken<unknown>;
45
46
  declare const graphRequest: <T>(root: any, params: any, ctx: any, resolveInfo: any) => Promise<T>;
46
47
  export { graphRequest };
47
- export { Driver } from 'neo4j-driver/types/v1';
48
+ export { Driver } from 'neo4j-driver';
@@ -34,8 +34,8 @@ let TypeService = class TypeService {
34
34
  c.excludedTypes.query = c.excludedTypes.query || { exclude: [] };
35
35
  c.excludedTypes.mutation = c.excludedTypes.mutation || { exclude: [] };
36
36
  c.excludedTypes = Object.assign(Object.assign({}, (0, helpers_1.exclude)(c, 'mutation', this.defaultExcludedTypes)), (0, helpers_1.exclude)(c, 'query', this.defaultExcludedTypes));
37
- c.excludedTypes.mutation.exclude = (0, helpers_1.mapToString)(c.excludedTypes.mutation.exclude);
38
- c.excludedTypes.mutation.exclude = (0, helpers_1.mapToString)(c.excludedTypes.mutation.exclude);
37
+ c.excludedTypes.mutation['exclude'] = (0, helpers_1.mapToString)(c.excludedTypes.mutation['exclude']);
38
+ c.excludedTypes.mutation['exclude'] = (0, helpers_1.mapToString)(c.excludedTypes.mutation['exclude']);
39
39
  return c;
40
40
  }
41
41
  };
@@ -1,7 +1,7 @@
1
- import { GraphQLSchema } from 'graphql';
2
1
  import { NEO4J_MODULE_CONFIG } from '../injection.tokens';
3
2
  import { GRAPHQL_PLUGIN_CONFIG } from '@rxdi/graphql';
4
- import { v1 as neo4j } from 'neo4j-driver';
3
+ import * as neo4j from 'neo4j-driver';
4
+ import { GraphQLSchema } from 'graphql';
5
5
  export declare class UtilService {
6
6
  private config;
7
7
  private gqlConfig;
@@ -14,13 +14,13 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.UtilService = void 0;
16
16
  const core_1 = require("@rxdi/core");
17
- const graphql_1 = require("graphql");
18
17
  const neo4jgql = require("neo4j-graphql-js");
19
18
  const injection_tokens_1 = require("../injection.tokens");
20
- const graphql_2 = require("@rxdi/graphql");
19
+ const graphql_1 = require("@rxdi/graphql");
21
20
  const graphql_tools_1 = require("graphql-tools");
22
- const neo4j_driver_1 = require("neo4j-driver");
21
+ const neo4j = require("neo4j-driver");
23
22
  const generate_type_defs_1 = require("../helpers/generate-type-defs");
23
+ const graphql_2 = require("graphql");
24
24
  let UtilService = class UtilService {
25
25
  constructor(config, gqlConfig) {
26
26
  this.config = config;
@@ -31,7 +31,7 @@ let UtilService = class UtilService {
31
31
  return augmentedSchema;
32
32
  }
33
33
  validateSchema(schema) {
34
- const schemaErrors = (0, graphql_1.validateSchema)(schema);
34
+ const schemaErrors = (0, graphql_2.validateSchema)(schema);
35
35
  if (schemaErrors.length) {
36
36
  throw new Error(JSON.stringify(schemaErrors));
37
37
  }
@@ -49,7 +49,7 @@ let UtilService = class UtilService {
49
49
  }), schemas.filter(s => !!s)[0]);
50
50
  }
51
51
  assignDriverToContext() {
52
- const driver = neo4j_driver_1.v1.driver(this.config.address || 'bolt://localhost:7687', neo4j_driver_1.v1.auth.basic(this.config.username, this.config.password));
52
+ const driver = neo4j.driver(this.config.address || 'bolt://localhost:7687', neo4j.auth.basic(this.config.username, this.config.password));
53
53
  this.gqlConfig.graphqlOptions.context = this.gqlConfig.graphqlOptions.context || {};
54
54
  Object.assign(this.gqlConfig.graphqlOptions.context, { driver });
55
55
  return driver;
@@ -58,7 +58,7 @@ let UtilService = class UtilService {
58
58
  UtilService = __decorate([
59
59
  (0, core_1.Injectable)(),
60
60
  __param(0, (0, core_1.Inject)(injection_tokens_1.NEO4J_MODULE_CONFIG)),
61
- __param(1, (0, core_1.Inject)(graphql_2.GRAPHQL_PLUGIN_CONFIG)),
61
+ __param(1, (0, core_1.Inject)(graphql_1.GRAPHQL_PLUGIN_CONFIG)),
62
62
  __metadata("design:paramtypes", [Object, Object])
63
63
  ], UtilService);
64
64
  exports.UtilService = UtilService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxdi/neo4j",
3
- "version": "0.7.151",
3
+ "version": "0.7.152",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -26,15 +26,15 @@
26
26
  },
27
27
  "homepage": "https://github.com/rxdi/neo4j/blob/master/README.md",
28
28
  "dependencies": {
29
- "neo4j-driver": "^1.7.2",
30
- "neo4j-graphql-js": "^2.14.0"
29
+ "neo4j-driver": "^5.0.1",
30
+ "neo4j-graphql-js": "^2.19.4"
31
31
  },
32
32
  "devDependencies": {
33
33
  "graphql": "^14.5.8",
34
34
  "@types/graphql": "^14.5.0",
35
35
  "graphql-tools": "^5.0.0",
36
- "@rxdi/core": "^0.7.150",
37
- "@rxdi/graphql": "^0.7.150",
36
+ "@rxdi/core": "^0.7.151",
37
+ "@rxdi/graphql": "^0.7.151",
38
38
  "@types/hapi": "^18.0.4",
39
39
  "@types/jest": "^24.0.22",
40
40
  "@types/node": "^12.0.10",