biantris / biantris/koa-server
new architecture
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## koa server overview
Future implementation under development for the server

### GraphQL
- GraphQL + Relay gives us great power over what we call data queries.
### Types
- As an example we have the component `EventType` where we pass all the fields that this type can receive:
- name;
- start;
- end;
- allDay; ...etc.
```graphql
const EventType = new GraphQLObjectType({
name: "Event",
description: "event data",
fields: () => ({
id: globalIdField("Event"),
name: {
type: GraphQLString,
resolve: event => event.name,
},
start: {
type: GraphQLString,
resolve: event => event.start.toISOString(),
},
end: {
type: GraphQLString,
resolve: event => event.end.toISOString(),
},
allDay: {
type: GraphQLBoolean,
resolve: event => event.allDay,
},
}),
interfaces: () => [nodeInterface],
});
```
### Connection
[wip]
### Mutations
- Used to modify/edit some data
- Ex: edit a user name, remove, create a new one
### Loaders
- These are components that use dataloader to batch and caching the calls to mongo. In other words, this reduces requests to the backend
- Caching: caching certain data
- Batching: processes that data
Read more about it here: https://github.com/graphql/dataloader
### MongoDB
#### Models
- They tell `mongoDB` how the data should be structured. mongoDB doesn't have schemas so we use `moongose` to tell the database how we want to structure it
### Jobs
[wip]
- Run certain events in Queues
- see more https://github.com/biantris/koa-server/issues/127
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.