Zendro-dev / graphql-server-model-codegen

Command line utility to auto-generate the structure files for a graphql server
MIT License
1 stars 2 forks source link

Throw an "No record exists with this ID" if no record can be found for a given ID #128

Closed asishallab closed 4 years ago

asishallab commented 4 years ago

Especially data model of storage-type SQL should throw an error, if there is no persistent record for the input argument ID (<idAttribtue>).

asishallab commented 4 years ago

This check, and possible error generation, should happen in the model layer. For generic models add a remark in the function comment (JSDoc) that such an error must be thrown if no record for the argument ID is found. Thus the programmer knows or is reminded to implement it in that way.

vsuaste commented 4 years ago

Done. Commit #4d47afb