-
Notifications
You must be signed in to change notification settings - Fork 73
Validation for relationships fails on valid case #2019
Comments
/cc @craicoverflow, @machi1990 |
I'm not sure if there is some fix here. |
So trick that I have done is:
|
See also #2020 |
What happens when you remove all manyToOne annotations from the data model? It should succeed |
It will fail validation (unless this change is applied) |
Can you show me the output? |
Can you reproduce this error using the models from the templates? They are smaller and more focused so it is easier to see why the error occurs - as in OVP the model is large and there could be other schema errors. |
I think this graphback/packages/graphback-core/src/relationships/RelationshipMetadataBuilder.ts Line 292 in 5201457
will need changing so that it compares the two keys if they are both defined (read as user defined values) since if they are not defined they'll be generated with key info:
What's your thoughts on this @craicoverflow ? |
That sounds better - this way you could have a manyToOne annotation with the key property and it would get updated, am I right? I think these patches we make to |
+1 on this. |
Closing as the case was valid and working as intended (it actually caught an invalid relationship association in the model). There is an issue #2023 to track a general improvement of relationships. |
Problem with OpenVolunteerModel
https://github.com/aerogear/OpenVolunteerPlatform/blob/master/platform/server/model/main.graphql#L38-L41
The action doesn't have a key specified and ManyToOne side has (this was just copied from the generated schema for visibility of the field in the schema)
Error is confusing as key is not there. Removing key from manyToOne will fix it.
The text was updated successfully, but these errors were encountered: