I ended up splitting this into 2 files for easier testing: Once you are done, you should have an object in JS that you can import into other files that gives you full query access to your database.One trick I found for easily generating both migrations and my initial database shape was to actually dump the state of my DB out to a file and use that as a raw SQL import.The short version is that it is a queryable schema for your API that allows clients to request only the data that they need, and gives a standardized system for exploring API endpoints without the need for reference documentation.I chose Graph QL because, after hearing a lot of buzz and playing around with some open Graphi QL endpoints I was hooked by the idea of being able to declare a schema for my data and let the client handle forming the exact shape of the request.
My main motivation here was to simplify deployment — it is far easier for me to upload a set of images to Docker Hub and do a simple than it is to write some scripts to set up my environment each time.
You can still use sequelize-cli to scaffold a Sequelize app, but you may need to make some modifications, especially to cli-generated models.
To get started, you can install sequelize-cli and run file in the models directory that creates a new instance of the ORM with the given configuration and associates all models with that instance.
I loved the idea of transferring the minimum amount over the wire, batching requests together for optimal payloads, and caching extensively on both the client and server.
This is the question that took me a long time to understand.