Skip to content
This repository was archived by the owner on May 25, 2020. It is now read-only.

willnode/gqldbms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. This server uses JSON to save data
  2. GraphQL objects are stored as JSON objects wrapped in array
  3. Listening to schema that defined by yours

Running

  1. Clone
  2. cargo run
  3. Go to localhost:3000/graphiql
  4. 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"
      }
    ]
  }
}

About

GraphQL drop-in Database Management Server in Rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published