Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Commit d372287

Browse files
committed
Merge branch 'master' of github.com:neo4j-graphql/neo4j-graphql-js
2 parents 0081dcf + 333f980 commit d372287

File tree

8 files changed

+5324
-5792
lines changed

8 files changed

+5324
-5792
lines changed

package-lock.json

Lines changed: 3093 additions & 4530 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
4949
"@babel/plugin-transform-runtime": "^7.0.0",
5050
"@babel/preset-env": "^7.10.4",
51+
"@graphql-inspector/core": "^2.3.0",
5152
"apollo-cache-inmemory": "^1.6.3",
5253
"apollo-client": "^2.6.10",
5354
"apollo-link-http": "^1.5.16",
@@ -57,7 +58,7 @@
5758
"body-parser": "^1.18.3",
5859
"express": "^4.17.1",
5960
"graphql-tag": "^2.10.1",
60-
"graphql-tools": "^4.0.8",
61+
"graphql-tools": "^7.0.2",
6162
"husky": "^0.14.3",
6263
"lint-staged": "^7.2.0",
6364
"node-fetch": "^2.3.0",
@@ -71,11 +72,13 @@
7172
"@babel/runtime-corejs2": "^7.5.5",
7273
"apollo-server-errors": "^2.4.1",
7374
"debug": "^4.1.1",
74-
"graphql": "^14.2.1",
7575
"graphql-auth-directives": "^2.2.1",
7676
"lodash": "^4.17.19",
7777
"neo4j-driver": "^4.1.0"
7878
},
79+
"peerDependencies": {
80+
"graphql": "^15.4.0"
81+
},
7982
"ava": {
8083
"require": [
8184
"@babel/register"

src/augment/augment.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
isTypeDefinitionNode,
66
isTypeExtensionNode
77
} from 'graphql';
8-
import { makeExecutableSchema } from 'graphql-tools';
8+
import { makeExecutableSchema, printSchemaWithDirectives } from 'graphql-tools';
99
import { buildDocument } from './ast';
1010
import {
1111
initializeOperationTypes,
@@ -32,7 +32,7 @@ export const makeAugmentedExecutableSchema = ({
3232
directiveResolvers,
3333
schemaDirectives = {},
3434
schemaTransforms = [],
35-
parseOptions,
35+
parseOptions = {},
3636
inheritResolversFromInterfaces,
3737
config
3838
}) => {
@@ -106,6 +106,8 @@ export const makeAugmentedExecutableSchema = ({
106106
};
107107
}
108108
resolverValidationOptions.requireResolversForResolveType = false;
109+
// FIXME get this working
110+
// parseOptions.commentDescriptions = true;
109111
return makeExecutableSchema({
110112
typeDefs: print(documentAST),
111113
resolvers: augmentedResolvers,
@@ -193,6 +195,10 @@ export const augmentedSchema = (schema, config) => {
193195
resolverValidationOptions: {
194196
requireResolversForResolveType: false
195197
},
198+
// FIXME get this working
199+
// parseOptions: {
200+
// commentDescriptions: true
201+
// },
196202
schemaDirectives
197203
});
198204
};
@@ -327,11 +333,10 @@ export const setDefaultConfig = ({ config = {} }) => {
327333
* regenerated schema type
328334
*/
329335
export const printSchemaDocument = ({ schema }) => {
330-
return print(
331-
buildDocument({
332-
definitions: extractSchemaDefinitions({ schema })
333-
})
334-
);
336+
return printSchemaWithDirectives(schema, {
337+
// FIXME add to testing once using this is supported
338+
// commentDescriptions: true
339+
});
335340
};
336341

337342
/**

src/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -956,12 +956,12 @@ export const removeIgnoredFields = (schemaType, selections) => {
956956
};
957957

958958
export const getInterfaceDerivedTypeNames = (schema, interfaceName) => {
959-
const implementingTypeMap = schema._implementations
960-
? schema._implementations[interfaceName]
959+
const implementingTypeMap = schema._implementationsMap
960+
? schema._implementationsMap[interfaceName]
961961
: {};
962962
let implementingTypes = [];
963-
if (implementingTypeMap) {
964-
implementingTypes = Object.values(implementingTypeMap).map(
963+
if (implementingTypeMap && implementingTypeMap.objects) {
964+
implementingTypes = Object.values(implementingTypeMap.objects).map(
965965
type => type.name
966966
);
967967
}

test/helpers/augmentSchemaTestHelpers.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

test/unit/assertSchema.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test('Call assertSchema for @id, @unique, and @index fields on node types', t =>
1313
auth: true
1414
}
1515
});
16-
const expected = `CALL apoc.schema.assert({State:["name"],UniqueNode:["anotherId"]}, {Movie:["movieId"],Person:["userId"],OldCamera:["id"],Camera:["id"],NewCamera:["id"],UniqueNode:["string","id"],UniqueStringNode:["uniqueString"]})`;
16+
const expected = `CALL apoc.schema.assert({State:["name"],UniqueNode:["anotherId"]}, {Movie:["movieId"],Person:["userId"],Camera:["id"],OldCamera:["id"],NewCamera:["id"],UniqueNode:["string","id"],UniqueStringNode:["uniqueString"]})`;
1717
const schemaAssertCypher = schemaAssert({ schema });
1818
t.is(schemaAssertCypher, expected);
1919
});

0 commit comments

Comments
 (0)