-
Notifications
You must be signed in to change notification settings - Fork 10
Folder Structure
Grial is a framework with a little convention over configuration paradigm. You can basically do whatever you want inside your project directory but Grial ask you to follow a basic file convention.
Aside of the below files you can create any other files, you can even split your API and application code in many little files and let this required files import them and use them internally.
Data source connectors, they can be your own custom connectors or you can just re-export the Grial connectors you download from npm.
Data loaders you can use to batch requests or queries. They are recreated per request and because of that have a single request cache. Receive the models and connectors and can use them internally to fetch data.
Your application models, they can use a single connector or even use multiple ones. Here's where your application business logic must reside.
Your API schema resolvers. The resolvers receive the connectors, loaders and models from context and allow you to use them as you want. They are intented to be as dummy as possible and you must keep your logic inside your models.
Your API schema definition. It's just a .gql
file with all your API schema.