Repository: graphql-rust/juniper (language: rust)

Issue:
Quickstart in book does not provide a working example
It is  painful to get started with Juniper due to the lack of a complete working example. The quickstart should provide a simple working example that compiles and runs out of the box. 

It would be really helpful to pick a server framework and provide a working example in the book, instead of referring to external examples. I would point out that there are a number of examples spread throughout the codebase, and none of them really address the beginner.

A couple of other observations:
 - mutations are not covered in enough depth. 
 - the lack of a rust client is conspicuously absent



Discussion / hints:

Fix patch:
diff --git a/juniper_actix/examples/actix_server.rs b/juniper_actix/examples/actix_server.rs
index 7c1e84931..722e5bcc2 100644
--- a/juniper_actix/examples/actix_server.rs
+++ b/juniper_actix/examples/actix_server.rs
@@ -1,16 +1,78 @@
 #![deny(warnings)]
 
-use std::env;
+use std::{collections::HashMap, env};
 
 use actix_cors::Cors;
 use actix_web::{http::header, middleware, web, App, Error, HttpResponse, HttpServer};
-use juniper::{
-    tests::fixtures::starwars::schema::{Database, Query},
-    EmptyMutation, EmptySubscription, RootNode,
-};
-use juniper_actix::{
-    graphiql_handler as gqli_handler, graphql_handler, playground_handler as play_handler,
-};
+use juniper::{graphql_object, EmptyMutation, EmptySubscription, GraphQLObject, RootNode};
+use juniper_actix::{graphiql_handler, graphql_handler, playground_handler};
+#[derive(Clone, GraphQLObject)]
+///a user
+pub struct User {
+    ///the id
+    id: i32,
+    ///the name
+    name: String,
+}
+
+#[derive(Default, Clone)]
+pub struct Database {
+    ///this could be a database connection
+    users: HashMap<i32, User>,
+}
+impl Database {
+    pub fn new() -> Database {
+        let mut users = HashMap::new();
+        users.insert(
+            1,
+            User {
+                id: 1,
+                name: "Aron".to_string(),
+            },
+        );
+        users.insert(
+            2,
+            User {
+                id: 2,
+                name: "Bea".to_string(),
+            },
+        );
+        users.insert(
+            3,
+            User {
+                id: 3,
+                name: "Carl".to_string(),
+            },
+        );
+        users.insert(
+            4,
+            User {
+                id: 4,
+                name: "Dora".to_string(),
+            },
+        );
+        Database { users }
+    }
+    pub fn get_user(&self, id: &i32) -> Option<&User> {
+        self.users.get(id)
+    }
+}
+
+// To make our Database usable by Juniper, we have to implement a marker trait.
+impl juniper::Context for Database {}
+
+// Queries represent the callable funcitons
+struct Query;
+#[graphql_object(context = Database)]
+impl Query {
+    fn apiVersion() -> String {
+        "1.0".to_string()
+    }
+    #[graphql(arguments(id(description = "id of the user")))]
+    fn user(database: &Database, id: i32) -> Option<&User> {
+        database.get_user(&id)
+    }
+}
 
 type Schema = RootNode<'static, Query, EmptyMutation<Database>, EmptySubscription<Database>>;
 
@@ -22,13 +84,13 @@ fn schema() -> Schema {
     )
 }
 
-async fn graphiql_handler() -> Result<HttpResponse, Error> {
-    gqli_handler("/", None).await
+async fn graphiql_route() -> Result<HttpResponse, Error> {
+    graphiql_handler("/graphgl", None).await
 }
-async fn playground_handler() -> Result<HttpResponse, Error> {
-    play_handler("/", None).await
+async fn playground_route() -> Result<HttpResponse, Error> {
+    playground_handler("/graphgl", None).await
 }
-async fn graphql(
+async fn graphql_route(
     req: actix_web::HttpRequest,
     payload: actix_web::web::Payload,
     schema: web::Data<Schema>,
@@ -57,12 +119,14 @@ async fn main() -> std::io::Result<()> {
                     .max_age(3600),
             )
             .service(
-                web::resource("/")
-                    .route(web::post().to(graphql))
-                    .route(web::get().to(graphql)),
+                web::resource("/graphgl")
+                    .route(web::post().to(graphql_route))
+                    .route(web::get().to(graphql_route)),
             )
-            .service(web::resource("/playground").route(web::get().to(playground_handler)))
-            .service(web::resource("/graphiql").route(web::get().to(graphiql_handler)))
+            .service(web::resource("/playground").route(web::get().to(playground_route)))
+            .service(web::resource("/graphiql").route(web::get().to(graphiql_route)))
     });
     server.bind("127.0.0.1:8080").unwrap().run().await
 }
+// now go to http://127.0.0.1:8080/playground or graphiql and execute
+//{  apiVersion,  user(id: 2){id, name}}


Test patch: