https://github.com/vladlinmoiseenko/graphql-project
GraphQL Playground Example
https://github.com/vladlinmoiseenko/graphql-project
juniper mysql ntex r2d2 rust
Last synced: 2 months ago
JSON representation
GraphQL Playground Example
- Host: GitHub
- URL: https://github.com/vladlinmoiseenko/graphql-project
- Owner: VladlinMoiseenko
- Created: 2022-06-24T05:21:09.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-24T14:31:02.000Z (about 4 years ago)
- Last Synced: 2025-01-25T22:21:20.243Z (over 1 year ago)
- Topics: juniper, mysql, ntex, r2d2, rust
- Language: Rust
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GraphQL Playground Example
[README_RUS](https://github.com/VladlinMoiseenko/graphql-project/blob/master/README_RUS.md): Русская версия README.
GraphQL Implementation in Rust using ntex, juniper, mysql with r2d2 for Database
The example is based on [graphql-demo](https://github.com/ntex-rs/examples/tree/master/graphql-demo)
## Database
Create a new database for this project, and import the existing database schema has been provided named mysql-schema.sql.
Create .env file on the root directory of this project and set environment variable named DATABASE_URL, the example file has been provided named .env.example
## Usage
```sh
cd graphql-project
cargo run
```
http://127.0.0.1:8080/graphiql
## Use GraphQL
GraphQL provides its own documentation. Click the "docs" link in the top right of the GraphiQL UI to see what types of queries and mutations are possible.
### Create a new user record
```
mutation {
createUser(
user: { name: "Pavel", email: "pavel@gmail.com"}
) {
id
name
email
}
}
```
### Query to get all users
```
{
users{
name
email
}
}
```