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
If I create a node using a model, the relationship does not have to be defined upon creation. Is it possible to force the relationship property to be required when creating a node using createOne?
My idea would be using beforeCreate to check if the relationship is defined and throw an error otherwise, but maybe @themetalfleece has a better option in mind? Best case I would like Typescript to handle this, not the JS runtime. Can I somehow cast the Neogma relationship types to accomplish this?
The text was updated successfully, but these errors were encountered:
@Ansis100 I had encountered same problem but ended up writing my own wrapper over neogma which does generate all models and types, and conducts relations validations
I tried to combine best of two worlds: ts' type safety and rails efficiency
Can you take a look ? I think it may solves your problem - neogen
It looks like a great option for managing the models, thanks! However, our project is quite big and migrating to a different model scheme would take a great deal of effort. I might think about implementing it when refactoring.
Currently we're just looking to modify one of our models with this functionality.
If I create a node using a model, the relationship does not have to be defined upon creation. Is it possible to force the relationship property to be required when creating a node using
createOne
?My idea would be using
beforeCreate
to check if the relationship is defined and throw an error otherwise, but maybe @themetalfleece has a better option in mind? Best case I would like Typescript to handle this, not the JS runtime. Can I somehow cast the Neogma relationship types to accomplish this?The text was updated successfully, but these errors were encountered: