GraphQL-Powered Database Management Server
A simple drop-in web server written in Rust for database powered with GraphQL.
No need to write resolvers, No need to depends on separate SQL servers.
How it Works
- This server uses JSON to save data
- GraphQL objects are stored as JSON objects wrapped in array
- Listening to schema that defined by yours
Running
- Clone
cargo run
- Go to
localhost:3000/graphiql
- Test it:
query AuthorWithPosts {
author(id: 1) {
username
posts {
id
title
}
}
feed {
id
title
author {
username
}
}
}
returns:
{
"data": {
"author": [
{
"posts": [
{
"id": 1,
"title": "Skywalker off the Road"
},
{
"id": 2,
"title": "Truth of Science"
}
],
"username": "John"
}
],
"feed": [
{
"author": {
"username": "John"
},
"id": 1,
"title": "Skywalker off the Road"
},
{
"author": {
"username": "John"
},
"id": 2,
"title": "Truth of Science"
},
{
"author": {
"username": "Alex"
},
"id": 3,
"title": "Celebrating Alex"
}
]
}
}