text: var express = require("express");
  var graphqlHTTP = require("express-graphql");
  var { buildSchema } = require("graphql");
  
  // Construct a schema, using GraphQL schema language
  var schema = buildSchema(`
    type Query {
      quoteOfTheDay: String
      random: Float!
      rollTheDice(numDice: Int!, numSides: Int): [Int]
    }
  `);
  
  // The root provides a resolver function for each API endpoint
  var root = {
    quoteOfTheDay: () => {
      return Math.random() < 0.5 ? "Take it easy" : " Hope lies within";
    },
    random: () => {
      return Math.random();
    },
    rollTheDice: ({ numDice, numSides }) => {
      let output = [];
      for (let i = 0; i < numDice; i++) {
        output.push(1 + Math.floor(Math.random() * (numSides || 6)));
      }
      return output;
    }
  };
  
  var app = express();
  app.use(
    "/graphql",
    graphqlHTTP({
      schema: schema,
      rootValue: root,
      graphiql: true
    })
  );
  app.listen(4000);
  console.log("Now browse to localhost:4000/graphql");
  