daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest May 16th, 2018 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const express = require('express');
  2. const egraphql = require('express-graphql');
  3. const {buildSchema} = require('graphql');
  4.  
  5. const schema = buildSchema(`
  6.     type Query {
  7.         message: String
  8.     }
  9. `);
  10.  
  11. const root = {
  12.     message: ()=> 'Hello world!',
  13. };
  14.  
  15. const app = express();
  16. app.use('/graphql', egraphql({
  17.     schema: schema,
  18.     rootValue: root,
  19.     graphiql: true,
  20. }));
  21.  
  22. app.listen(5000, ()=> console.log('running ', 5000));
RAW Paste Data
Top