Error: relation type "HasManyRelation" is not supported
at SchemaBuilder._relationField (/.../node_modules/objection-graphql/lib/SchemaBuilder.js:243:11)
Looking at the code in the _relationField method it seems that HasManyRelationshould be supported.
Not 100% sure why this is happening, but it might be related to the fact that I have all my models defined in a separate NPM package so the instanceof objection.HasManyRelation check isn't referring to the same instance of objection that the models were built with?
I have two models (
Order
andOrderItems
) whereOrder
hasrelationMappings
defined as follows:When I use the GraphQL Builder, as follows:
I get the following error:
Looking at the code in the
_relationField
method it seems thatHasManyRelation
should be supported.Not 100% sure why this is happening, but it might be related to the fact that I have all my models defined in a separate NPM package so the
instanceof objection.HasManyRelation
check isn't referring to the same instance ofobjection
that the models were built with?