Closed timbaas closed 6 years ago
Hi @timbaas . This library utilizes Objection Model JSON schema to generate GraphQL fields. On the other hand, as you mentioned, if the field is a part of the schema it is supposed to exist in the db. So, virtual attributes are not supported yet, but I think it's worth implementing in the future.
I just submitted a pull request which should facilitate this need: https://github.com/Vincit/objection-graphql/pull/55
@timhuff why was PR #55 reverted? Is there another way to handle virtual attributes?
Ignore... I found PR #57
Hi there,
I can't find any way to get around the following.
I've got a Model ("Exchange") with a db column ("name") and a virtual attribute ("marketCount"):
When defining "marketCount" in jsonSchema properties it tries to select the column from the db, which of course doesn't exist and when leaving it out it isn't available in the GraphQL Schema, so the query fails.
I find it hard to believe this wouldn't be possible but didn't find the answer either.
Anything I don't know of?