Does anyone perhaps have a small (but complete) example of an app source that demonstrates the use of Mutations (hopefully multiple Mutations).
My API server resides in a main file: server.js, and I want to import the Mutation definitions into this, and not define them directly in server.js. I will have several hundred mutations, and I need to be able to import them in a structured manner and not define them all in a single file.
Currently, if I try this, I cannot seem to get access to the Models inside the mutation, to be able to write to the DB. Even the tests say that the mutations are working, but they omit the all-important step of actually writing to the DB via Objection.
Hi,
Does anyone perhaps have a small (but complete) example of an app source that demonstrates the use of Mutations (hopefully multiple Mutations).
My API server resides in a main file:
server.js
, and I want to import the Mutation definitions into this, and not define them directly inserver.js
. I will have several hundred mutations, and I need to be able to import them in a structured manner and not define them all in a single file.Currently, if I try this, I cannot seem to get access to the Models inside the mutation, to be able to write to the DB. Even the tests say that the mutations are working, but they omit the all-important step of actually writing to the DB via Objection.
TIA