Closed metmirr closed 3 years ago
@metmirr Are you sure that record has a value in the DB?
Yes, I am. Resolver without @Fields
argument return this data:
Note that I needed to update the behavior of the Fields
decorator to include all top-level fields. This will bring along both JSON fields as well as associations. Then BaseModel
makes sure all values passed into find
are actually fields on the table. This is technically a breaking change - but I'd argue the Fields
decorator wasn't really working as designed anyway. Do you think this is ok, or should I create a new decorator with the new behavior?
I've merged this. Feel free to play around and let me know if you think anything needs to be tweaked.
Note that I needed to update the behavior of the
Fields
decorator to include all top-level fields. This will bring along both JSON fields as well as associations. ThenBaseModel
makes sure all values passed intofind
are actually fields on the table. This is technically a breaking change - but I'd argue theFields
decorator wasn't really working as designed anyway. Do you think this is ok, or should I create a new decorator with the new behavior?
I think this is it, the decorator is working as expected with jsons, relations etc.
I've merged this. Feel free to play around and let me know if you think anything needs to be tweaked.
Working perfectly as expected, thank you so much! Really appreciated!
Resolvers don't fetch typed json fields when a resolver function has the
@Fields
parameter. The example below is taken from examples/02: