Vincit / objection-graphql

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

Anyone have a small sample project that implements mutations? #81

Open Trellian opened 5 years ago

Trellian commented 5 years ago

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 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.

TIA