1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00
examples/graphql/juniper-advanced/README.md

35 lines
904 B
Markdown
Raw Permalink Normal View History

2022-02-17 22:29:55 +01:00
# GraphQL using Juniper and MySQL
2022-02-17 21:59:04 +01:00
GraphQL Implementation in Rust using Actix, Juniper, and MySQL as Database
2021-04-26 13:32:32 +02:00
## Prerequisites
2022-02-17 21:59:04 +01:00
- MySQL server
2021-04-26 13:32:32 +02:00
## Database Configuration
2022-02-17 21:59:04 +01:00
Create a new database for this project, and import the existing database schema has been provided named `mysql-schema.sql`.
2022-02-17 21:59:04 +01:00
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.
2022-02-17 21:59:04 +01:00
```sh
cat mysql-schema.sql | mysql -u root -D graphql_testing
```
## Usage
```sh
cd graphql/juniper-advanced
2022-02-17 21:59:04 +01:00
cp .env.example .env
# edit .env and insert your DB credentials
cargo run
```
2021-04-26 13:32:32 +02:00
## GraphQL Playground
2022-02-17 21:59:04 +01:00
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
```