You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'use strict';const{ Neo4jGraphQL }=require('@neo4j/graphql');constneo4j=require('neo4j-driver');constdriver=neo4j.driver('bolt://localhost:7687',neo4j.auth.basic('*****','*****'),);consttypeDefs=` type Tiger { x: Int } type TigerJawLevel2 { id: ID part1: TigerJawLevel2Part1 @relationship(type: "REL1", direction: OUT) } type TigerJawLevel2Part1 { id: ID tiger: Tiger @relationship(type: "REL2", direction: OUT) }`;newNeo4jGraphQL({
driver,
typeDefs,});
Setup
Run the command npm install --no-save.
Steps to reproduce
Run the command node server.js.
Expected outcome
Nothing. That is, the command should exit almost immediately, with no output.
Actual outcome
The following error message:
/app/node_modules/graphql/validation/validate.js:107
throw new Error(errors.map(function (error) {
^
Error: There can be only one type named "TigerJawLevel2Part1DeleteInput".
at assertValidSDL (/app/node_modules/graphql/validation/validate.js:107:11)
at Object.buildASTSchema (/app/node_modules/graphql/utilities/buildASTSchema.js:45:34)
at buildSchemaFromTypeDefinitions (/app/node_modules/@graphql-tools/schema/index.cjs.js:203:26)
at Object.makeExecutableSchema (/app/node_modules/@graphql-tools/schema/index.cjs.js:749:18)
at Object.makeAugmentedSchema (/app/node_modules/@neo4j/graphql/dist/schema/make-augmented-schema.js:594:29)
at new Neo4jGraphQL (/app/node_modules/@neo4j/graphql/dist/classes/Neo4jGraphQL.js:40:44)
at Object.<anonymous> (/app/server.js:27:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
Analysis
TigerJawLevel2Part1DeleteInput, the type that appears in the error message, is obviously a type created by @neo4j/graphql. (See the documentation here.) It appears that @neo4j/graphql creates two instances of this type. That behavior is surely a bug.
The text was updated successfully, but these errors were encountered:
I haven't investigated this yet, but I suspect that the two DeleteInput types are:
The input type for deleting TigerJawLevel2Part1 objects through the part1 field of the TigerJawLevel2 object - appended together you get "TigerJawLevel2" + "Part1" + "DeleteInput".
The input type for deleting TigerJawLevel2Part1 objects directly as a Mutation - appended together you get "TigerJawLevel2Part1" + "DeleteInput".
The resulting input type name is the same through both routes, which is obviously a problem! Realistically, I think the first input type should have been called TigerJawLevel2Part1DeleteFieldInput and this just slipped through the net.
I believe I've found a bug in
@neo4j/graphql
. To reproduce it, see below.Software
Files
package.json
server.js
Setup
npm install --no-save
.Steps to reproduce
node server.js
.Expected outcome
Nothing. That is, the command should exit almost immediately, with no output.
Actual outcome
The following error message:
Analysis
TigerJawLevel2Part1DeleteInput
, the type that appears in the error message, is obviously a type created by@neo4j/graphql
. (See the documentation here.) It appears that@neo4j/graphql
creates two instances of this type. That behavior is surely a bug.The text was updated successfully, but these errors were encountered: