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
Now if I use the new Model class instead of the GraphQLObjectType then join-monster fails, since it relies on the constructor.name to recognize tables, as you can see here.
But in my case, due to extending the class, constructor.name becomes Model, so it wont recognize it as GraphQLObjectType anymore.
A possible solution is to check if the parent is a GraphQLObjectType by something like: Object.getPrototypeOf(instance.constructor) === GraphQLObjectType.
(But this should be done recursively, to support multilevel inheritance.)
Is there any workaround which can help in my usecase?
Environment
Version of this library used: 3.0.1
The text was updated successfully, but these errors were encountered:
Description
If I create a GraphQL type the following way, then everything works as expected:
But for some specific reason, I have to extend the
GraphQLObjectType
type to abstact away a couple of things:Now if I use the new
Model
class instead of theGraphQLObjectType
thenjoin-monster
fails, since it relies on theconstructor.name
to recognize tables, as you can see here.But in my case, due to extending the class,
constructor.name
becomesModel
, so it wont recognize it asGraphQLObjectType
anymore.A possible solution is to check if the parent is a
GraphQLObjectType
by something like:Object.getPrototypeOf(instance.constructor) === GraphQLObjectType
.(But this should be done recursively, to support multilevel inheritance.)
Is there any workaround which can help in my usecase?
Environment
The text was updated successfully, but these errors were encountered: