Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanay-pingalkar/rust-graphql
a crud graphql actix diesel server made in rust
https://github.com/tanay-pingalkar/rust-graphql
actix-web diesel graphql junifer rust
Last synced: 21 days ago
JSON representation
a crud graphql actix diesel server made in rust
- Host: GitHub
- URL: https://github.com/tanay-pingalkar/rust-graphql
- Owner: tanay-pingalkar
- Created: 2021-06-24T11:34:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-25T20:09:35.000Z (over 3 years ago)
- Last Synced: 2024-01-18T23:54:04.653Z (11 months ago)
- Topics: actix-web, diesel, graphql, junifer, rust
- Language: Rust
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rust-graphql
a crud graphql actix diesel server made in rust## setup
```
! rust/cargo/postgres should have installed !
===================================================================================
~ cargo install
===================================================================================
~ cargo install diesel_cli --no-default-features --features postgres
===================================================================================
~ psql
===================================================================================
~ CREATE DATABASE rust_graphql
===================================================================================
~ echo DATABASE_URL=postgresql://postgres:password@localhost/rust_graphql > .env
===================================================================================
~ diesel migration run
===================================================================================
~ cargo run
===================================================================================
```open `http://localhost:5000/graphql`
## graphql api
``` graphql
# fetch all posts
{
posts {
id
title
}
}# create a post
mutation {
post(title:"this is cool"){
id
title
}
}# delete post
mutation {
delete(id:1){
id
title
}
}# edit post
mutation {
edit(postInfo:{
id:1,
newTitle:"new title"
}){
id
title
}
}# get one post
{
post(postId:3){
id
title
}
}
```