()
| 28 | } |
| 29 | |
| 30 | pub fn routes() -> Routes { |
| 31 | // Define route |
| 32 | Routes::new() |
| 33 | // We put all GraphQL route behind `graphql` prefix |
| 34 | .prefix("graphql") |
| 35 | // GraphQL playground page is a GET request |
| 36 | .add("/", get(graphql_playground)) |
| 37 | // GraphQL handler is a POST request |
| 38 | .add("/", post(graphql_handler)) |
| 39 | } |