Vincit / objection-graphql

GraphQL schema generator for objection.js
MIT License
307 stars 35 forks source link

Set writeOnly and readOnly jsonSchema's value options #87

Open amendezcabrera opened 4 years ago

amendezcabrera commented 4 years ago

I am using your library to automatically generate the GraphQL Schema but I need to set some values from the jsonSchema as readOnly and writeOnly as shown in their docs. Is this possible? And how can I do it? Thank you

amendezcabrera commented 4 years ago

This can be achieved in the afterGet method:

$afterGet(queryContext) {
    delete this.returning_value;
}

It would be nice to just set the writeOnly parameter to the property but this does the job.