1
0
mirror of https://github.com/actix/examples synced 2025-06-27 01:27:43 +02:00

update graphql advanced example

This commit is contained in:
Rob Ede
2022-02-17 20:59:04 +00:00
parent 7a3fc52a70
commit e0888cd255
9 changed files with 72 additions and 76 deletions

View File

@ -1,28 +1,34 @@
# juniper-advanced
GraphQL Implementation in Rust using Actix, Juniper, and Mysql as Database
GraphQL Implementation in Rust using Actix, Juniper, and MySQL as Database
## Prerequisites
- Rust Installed
- MySql as Database
- MySQL server
## Database Configuration
Create a new database for this project, and import the existing database schema has been provided named ```mysql-schema.sql```.
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```, you can see the format on there.
## Run
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`, you can see the format in there.
```sh
cat mysql-schema.sql | mysql -u root -D graphql_testing
```
## Usage
```sh
# go to the root dir
cd graphql/juniper-advanced
cp .env.example .env
# edit .env and insert your DB credentials
cargo run
```
## GraphQL Playground
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.
```
http://localhost:8080/graphiql
```
http://127.0.0.1:8080/graphiql
```