Open btroop opened 5 years ago
I've run into the same problem. It works fine if the first field is scalar, and breaks with the same type of error if the first field is a relation. There's no difference in the actual fields, just their order in the type definition.
From very cursory testing, it looks like the first field defined on a type is used to define the auto-generated _*Input
types. GraphQL input types can only have scalar fields, so it makes sense that the resulting schema would not validate.
I think I found a bug where, in the type definitions, if the first field on a type is not a scalar the auto generated mutations fail to pass validation, resulting in the following error:
The type of Mutation.Update(\<field>:) must be Input Type but got: \<Type>!
here's the type def I was playing around with that caused the issue.
works:
throws error:
I kept deleting fields referring to other types and restarting the server until I got down to the "beginningMileage" field; the error promptly went away once the first field was the scalar type.
Neo4j 3.5, neo4jgraphql-js @ 2.3.1, makeAugmentedSchema({typeDefs})