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
{{ message }}
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
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>!
throw new Error(errors.map(function (error) {
Error: The type of Mutation.UpdateRentalAgreement(renter:) must be Input Type but got: Renter!.
The type of Mutation.DeleteRentalAgreement(renter:) must be Input Type but got: Renter!.
The type of _RentalAgreementInput.renter must be Input Type but got: Renter!.
here's the type def I was playing around with that caused the issue.
works:
type RentalAgreement {
uuid: ID
renter: Renter @relation(name:"RENTER", direction:"OUT")
vehicle: Vehicle @relation(name:"VEHICLE_RENTED", direction: "OUT")
rentedFrom: RentalLocation @relation(name:"RENTED_FROM", direction:"OUT")
returnedTo: RentalLocation @relation(name:"RETURNED_TO", direction:"OUT")
beginningMileage: Int
endingMileage: Int
startDate: String
endDate: String
status: String
createdBy: Employee @relation(name:"CREATED", direction:"IN")
}
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.
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})
The text was updated successfully, but these errors were encountered: