[
  {
    "path": ".eslintignore",
    "content": "public/bundle.js\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"extends\": \"eslint:recommended\",\n  \"env\": {\n    \"browser\": true,\n    \"node\": true,\n    \"es6\": true,\n    \"mocha\": true\n  },\n  \"parserOptions\": {\n    \"ecmaFeatures\": {\n      \"jsx\": true\n    }\n  },\n  \"rules\": {\n\n    // relaxed restrictions\n    \"no-mixed-requires\": 0,\n    \"no-underscore-dangle\": 0,\n    \"no-shadow\": 0,\n    \"no-use-before-define\": [2, \"nofunc\"],\n    \"camelcase\": [2, {\"properties\": \"never\"}],\n    \"curly\": 0,\n    \"eqeqeq\": 0,\n    \"new-parens\": 0,\n    \"quotes\": [2, \"single\", \"avoid-escape\"],\n    \"semi\": [2, \"never\"],\n    \"strict\": 0,\n\n    // extra restrictions\n    \"no-empty-character-class\": 2,\n    \"no-extra-parens\": [2, \"functions\"],\n    \"no-floating-decimal\": 2,\n    \"no-lonely-if\": 2,\n    \"no-self-compare\": 2,\n    \"no-throw-literal\": 2,\n    \"no-unused-vars\": 2,\n\n    // style\n    \"array-bracket-spacing\": [2, \"never\"],\n    \"brace-style\": [2, \"1tbs\", {\"allowSingleLine\": true}],\n    \"comma-dangle\": [2, \"always-multiline\"],\n    \"comma-style\": [2, \"last\"],\n    \"consistent-this\": [2, \"self\"],\n    \"object-curly-spacing\": [2, \"never\"],\n    \"operator-assignment\": [2, \"always\"],\n    \"operator-linebreak\": [2, \"after\"],\n    \"keyword-spacing\": 2,\n    \"space-before-blocks\": [2, \"always\"],\n    \"space-before-function-paren\": [2, \"never\"],\n    \"space-in-parens\": [2, \"never\"],\n    \"spaced-comment\": [2, \"always\"]\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\nnpm-debug.log\n.tern-port\nv8.log\n\nschema/schema.json\npublic/bundle.js\n"
  },
  {
    "path": "App.js",
    "content": "var React = require('react')\nvar Relay = require('react-relay')\n\n// A simple top-level component that illustrates how to render Relay-fetched\n// data using props. In this case Relay will populate a `user` property that\n// has a collection of `widgets` based on the queries and fragments we give it\n// further below.\nclass App extends React.Component {\n  render() {\n    return (\n      <div>\n        <h2>User: {this.props.user.name}</h2>\n        <h2>Widgets:</h2>\n        <ul>\n          {/* In schema/schema.js we define a Connection between users and widgets */}\n          {/* Connections use `edges` and `node` to hold paging info and child items */}\n          {this.props.user.widgets.edges.map(edge =>\n            <li key={edge.node.id}>{edge.node.name} (Global ID: {edge.node.id})</li>\n          )}\n        </ul>\n      </div>\n    )\n  }\n}\n\n// The component we need to export is a Relay wrapper around our App component\n// from above. It declares the GraphQL fragments where we list the properties\n// we want to be fetched – eg, user.name, user.widgets.edges, etc\nexports.Container = Relay.createContainer(App, {\n  fragments: {\n    // The property name here reflects what is added to `this.props` above.\n    // This template string will be parsed by babel-relay-plugin when we browserify.\n    user: () => Relay.QL`\n      fragment on User {\n        name,\n        widgets(first: 10) {\n          edges {\n            node {\n              id,\n              name,\n            },\n          },\n        },\n      }\n    `,\n  },\n})\n\n// The Relay root container needs to know what queries will occur at the top\n// level – these configurations are currently called Routes in Relay, but this\n// name is misleading and under review so we don't use it here.\nexports.queries = {\n  name: 'AppQueries', // can be anything, just used as an identifier\n  params: {},\n  queries: {\n    // We can use this shorthand so long as the component we pair this with has\n    // a fragment named \"user\", as we do above.\n    user: () => Relay.QL`query { user }`,\n  },\n}\n\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright 2015 Michael Hart (michael.hart.au@gmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "simple-relay-starter\n--------------------\n\nA simple example of how to get started with\n[Relay](https://facebook.github.io/relay/) using some slightly different\napproaches to [relay-starter-kit](https://github.com/relayjs/relay-starter-kit)\nthat may make it easier to navigate for first-time users, especially Node.js\nusers.\n\nUnlike [relay-starter-kit](https://github.com/relayjs/relay-starter-kit), this\nproject uses [Browserify](http://browserify.org/) instead of\n[Webpack](https://webpack.github.io/), does not use a proxy for the GraphQL\nendpoint and does not require ES6 features for any server-side code, so it can\nbe run directly with `node` – resulting in less boilerplate and making it\neasier to understand the code.\n\nExample\n-------\n\n```console\n$ npm install\n$ npm run build\n$ npm start\n```\n\nThen navigate to [http://localhost:3000](http://localhost:3000) and\nobserve the network request to `/graphql` that Relay makes to retrieve the data.\n\nFor development, you can use:\n\n```console\n$ npm run dev\n```\n\nWhich will build the schema and then watch for any file changes, rebuilding the\nschema and/or restarting the server as necessary.\n\nHere are the files involved:\n\n`App.js`:\n```js\nvar React = require('react')\nvar Relay = require('react-relay')\n\n// A simple top-level component that illustrates how to render Relay-fetched\n// data using props. In this case Relay will populate a `user` property that\n// has a collection of `widgets` based on the queries and fragments we give it\n// further below.\nclass App extends React.Component {\n  render() {\n    return (\n      <div>\n        <h2>User: {this.props.user.name}</h2>\n        <h2>Widgets:</h2>\n        <ul>\n          {/* In schema/schema.js we define a Connection between users and widgets */}\n          {/* Connections use `edges` and `node` to hold paging info and child items */}\n          {this.props.user.widgets.edges.map(edge =>\n            <li>{edge.node.name} (Global ID: {edge.node.id})</li>\n          )}\n        </ul>\n      </div>\n    )\n  }\n}\n\n// The component we need to export is a Relay wrapper around our App component\n// from above. It declares the GraphQL fragments where we list the properties\n// we want to be fetched – eg, user.name, user.widgets.edges, etc\nexports.Container = Relay.createContainer(App, {\n  fragments: {\n    // The property name here reflects what is added to `this.props` above.\n    // This template string will be parsed by babel-relay-plugin when we browserify.\n    user: () => Relay.QL`\n      fragment on User {\n        name,\n        widgets(first: 10) {\n          edges {\n            node {\n              id,\n              name,\n            },\n          },\n        },\n      }\n    `,\n  },\n})\n\n// The Relay root container needs to know what queries will occur at the top\n// level – these configurations are currently called Routes in Relay, but this\n// name is misleading and under review so we don't use it here.\nexports.queries = {\n  name: 'AppQueries', // can be anything, just used as an identifier\n  params: {},\n  queries: {\n    // We can use this shorthand so long as the component we pair this with has\n    // a fragment named \"user\", as we do above.\n    user: () => Relay.QL`query { user }`,\n  },\n}\n```\n\n`browser.js`:\n```js\nvar React = require('react')\nvar ReactDOM = require('react-dom')\nvar Relay = require('react-relay')\nvar App = require('./App')\n\n// This file is the entry point on the browser – browserify will compile it, as\n// well as App.js and any other client-side dependencies and create\n// public/bundle.js which will be requested by public/index.html\n\nReactDOM.render(\n  // At the top of a Relay tree is the root container, which we pass our\n  // wrapped App component to, as well as the query configuration (\"route\"). If\n  // we need to render a different component, say as a result of a navigation\n  // event, then we would update it here.\n  // We also illustrate the use of the onReadyStateChange handler in case\n  // there's a network error, etc\n  <Relay.RootContainer Component={App.Container} route={App.queries}\n    onReadyStateChange={({error}) => { if (error) console.error(error) }} />,\n\n  document.getElementById('content')\n)\n```\n\n`public/index.html`:\n```html\n<!-- include React and Relay scripts (we don't bundle them) -->\n<script src=//cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js></script>\n<script src=//cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js></script>\n<script src=/relay/relay.min.js></script>\n<div id=content />\n<!-- now request our browserified bundle which will run the React.render -->\n<script src=/bundle.js></script>\n```\n\n`server.js`:\n```js\nvar express = require('express')\nvar graphqlHttp = require('express-graphql')\nvar schema = require('./schema/schema')\n\n// The server is just a simple Express app\nvar app = express()\n\n// We respond to all GraphQL requests from `/graphql` using the\n// `express-graphql` middleware, which we pass our schema to.\napp.use('/graphql', graphqlHttp({schema: schema}))\n\n// The rest of the routes are just for serving static files\napp.use('/relay', express.static('./node_modules/react-relay/dist'))\napp.use('/', express.static('./public'))\n\napp.listen(3000, function() { console.log('Listening on 3000...') })\n```\n\n`schema/database.js`:\n```js\n// We use these types to hold data and resolve from GraphQL types in our schema\n\nfunction User(id, name) {\n  this.id = id.toString()\n  this.name = name\n}\n\nfunction Widget(id, userId, name) {\n  this.id = id.toString()\n  this.userId = userId.toString()\n  this.name = name\n}\n\n// In a realistic system, the get functions below would return objects from a\n// datastore like a DB or a REST API instead of an in-memory store like this.\n// You can also return promises for async fetching\n\nvar users = [new User(1, 'Anonymous')]\n\nvar widgets = [\n  new Widget(1, 1, 'What\\'s-it'),\n  new Widget(2, 1, 'Who\\'s-it'),\n  new Widget(3, 1, 'How\\'s-it'),\n]\n\nmodule.exports = {\n  User: User,\n  Widget: Widget,\n  getUser: function(id) { return users.filter(function(u) { return u.id == id })[0] },\n  getAnonymousUser: function() { return users[0] },\n  getWidget: function(id) { return widgets.filter(function(w) { return w.id == id })[0] },\n  getWidgetsByUser: function(userId) { return widgets.filter(function(w) { return w.userId == userId }) },\n}\n```\n\n`schema/schema.js`:\n```js\nvar GraphQL = require('graphql')\nvar GraphQLRelay = require('graphql-relay')\nvar db = require('./database')\n\n// This module exports a GraphQL Schema, which is a declaration of all the\n// types, queries and mutations we'll use in our system.\n\n// Relay adds some specific types that it needs to function, including Node, Edge, Connection\n\n// Firstly we need to create the Node interface in our system. This has nothing\n// to do with Node.js! In Relay, Node refers to an entity – that is, an object\n// with an ID.\n\n// To create this interface, we need to pass in a resolving function as the\n// first arg to nodeDefinitions that can fetch an entity given a global Relay\n// ID. The second arg can be used to resolve an entity into a GraphQL type –\n// but it's actually optional, so we'll leave it out and use isTypeOf on the\n// GraphQL types further below.\n\nvar nodeDefinitions = GraphQLRelay.nodeDefinitions(function(globalId) {\n  var idInfo = GraphQLRelay.fromGlobalId(globalId)\n  if (idInfo.type == 'User') {\n    return db.getUser(idInfo.id)\n  } else if (idInfo.type == 'Widget') {\n    return db.getWidget(idInfo.id)\n  }\n  return null\n})\n\n// We can now use the Node interface in the GraphQL types of our schema\n\nvar widgetType = new GraphQL.GraphQLObjectType({\n  name: 'Widget',\n  description: 'A shiny widget',\n\n  // Relay will use this function to determine if an object in your system is\n  // of a particular GraphQL type\n  isTypeOf: function(obj) { return obj instanceof db.Widget },\n\n  // We can either declare our fields as an object of name-to-definition\n  // mappings or a closure that returns said object (see userType below)\n  fields: {\n    id: GraphQLRelay.globalIdField('Widget'),\n    name: {\n      type: GraphQL.GraphQLString,\n      description: 'The name of the widget',\n    },\n  },\n  // This declares this GraphQL type as a Node\n  interfaces: [nodeDefinitions.nodeInterface],\n})\n\nvar userType = new GraphQL.GraphQLObjectType({\n  name: 'User',\n  description: 'A person who uses our app',\n  isTypeOf: function(obj) { return obj instanceof db.User },\n\n  // We use a closure here because we need to refer to widgetType from above\n  fields: function() {\n    return {\n      id: GraphQLRelay.globalIdField('User'),\n      name: {\n        type: GraphQL.GraphQLString,\n        description: 'The name of the user',\n      },\n      // Here we set up a paged one-to-many relationship (\"Connection\")\n      widgets: {\n        description: 'A user\\'s collection of widgets',\n\n        // Relay gives us helper functions to define the Connection and its args\n        type: GraphQLRelay.connectionDefinitions({name: 'Widget', nodeType: widgetType}).connectionType,\n        args: GraphQLRelay.connectionArgs,\n\n        // You can define a resolving function for any field.\n        // It can also return a promise if you need async data fetching\n        resolve: function(user, args) {\n          // This wraps a Connection object around your data array\n          // Use connectionFromPromisedArray if you return a promise instead\n          return GraphQLRelay.connectionFromArray(db.getWidgetsByUser(user.id), args)\n        },\n      },\n    }\n  },\n  interfaces: [nodeDefinitions.nodeInterface],\n})\n\n// Now we can bundle our types up and export a schema\n// GraphQL expects a set of top-level queries and optional mutations (we have\n// none in this simple example so we leave the mutation field out)\nmodule.exports = new GraphQL.GraphQLSchema({\n  query: new GraphQL.GraphQLObjectType({\n    name: 'Query',\n    fields: {\n      // Relay needs this to query Nodes using global IDs\n      node: nodeDefinitions.nodeField,\n      // Our own root query field(s) go here\n      user: {\n        type: userType,\n        resolve: function() { return db.getAnonymousUser() },\n      },\n    },\n  }),\n})\n```\n"
  },
  {
    "path": "browser.js",
    "content": "var React = require('react') // eslint-disable-line no-unused-vars\nvar ReactDOM = require('react-dom')\nvar Relay = require('react-relay') // eslint-disable-line no-unused-vars\nvar App = require('./App')\n\n// This file is the entry point on the browser – browserify will compile it, as\n// well as App.js and any other client-side dependencies and create\n// public/bundle.js which will be requested by public/index.html\n\nReactDOM.render(\n  // At the top of a Relay tree is the root container, which we pass our\n  // wrapped App component to, as well as the query configuration (\"route\"). If\n  // we need to render a different component, say as a result of a navigation\n  // event, then we would update it here.\n  // We also illustrate the use of the onReadyStateChange handler in case\n  // there's a network error, etc\n  <Relay.RootContainer Component={App.Container} route={App.queries}\n    onReadyStateChange={({error}) => { if (error) console.error(error) }} />, // eslint-disable-line no-console\n\n  document.getElementById('content')\n)\n\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"simple-relay-starter\",\n  \"version\": \"1.3.12\",\n  \"description\": \"A very simple example of React Relay using Browserify\",\n  \"main\": \"server.js\",\n  \"repository\": \"mhart/simple-relay-starter\",\n  \"keywords\": [\n    \"react\",\n    \"reactjs\",\n    \"relay\",\n    \"browserify\",\n    \"graphql\"\n  ],\n  \"author\": \"Michael Hart <michael.hart.au@gmail.com>\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"express\": \"^4.14.0\",\n    \"express-graphql\": \"^0.6.2\",\n    \"graphql\": \"^0.9.1\",\n    \"graphql-relay\": \"^0.5.1\",\n    \"react\": \"^15.4.2\",\n    \"react-dom\": \"^15.4.2\",\n    \"react-relay\": \"^0.10.0\"\n  },\n  \"devDependencies\": {\n    \"babel-preset-es2015\": \"^6.22.0\",\n    \"babel-preset-react\": \"^6.22.0\",\n    \"babel-relay-plugin\": \"^0.10.0\",\n    \"babelify\": \"^7.3.0\",\n    \"browserify\": \"^14.0.0\",\n    \"browserify-shim\": \"^3.8.13\",\n    \"nodemon\": \"^1.11.0\",\n    \"onchange\": \"^3.2.1\",\n    \"parallelshell\": \"^2.0.0\"\n  },\n  \"browserify-shim\": {\n    \"react\": \"global:React\",\n    \"react-dom\": \"global:ReactDOM\",\n    \"react-relay\": \"global:Relay\"\n  },\n  \"browserify\": {\n    \"transform\": [\n      [\n        \"babelify\",\n        {\n          \"presets\": [\n            \"es2015\",\n            \"react\"\n          ],\n          \"plugins\": [\n            \"./utils/babelRelayPlugin\"\n          ]\n        }\n      ],\n      \"browserify-shim\"\n    ]\n  },\n  \"scripts\": {\n    \"start\": \"node server.js\",\n    \"dev\": \"npm run build && npm run watch\",\n    \"build\": \"npm run build:schema && npm run build:browser\",\n    \"build:schema\": \"node ./utils/updateSchema.js\",\n    \"build:browser\": \"browserify browser.js -o public/bundle.js\",\n    \"watch\": \"parallelshell 'npm run watch:schema' 'npm run watch:browser' 'npm run watch:server'\",\n    \"watch:schema\": \"onchange schema/schema.js -- npm run build:schema\",\n    \"watch:browser\": \"onchange browser.js App.js schema/schema.json -- npm run build:browser\",\n    \"watch:server\": \"nodemon --watch server.js --watch 'schema/*.js' server.js\"\n  }\n}\n"
  },
  {
    "path": "public/index.html",
    "content": "<!-- include React and Relay scripts (we don't bundle them) -->\n<script src=//cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.min.js></script>\n<script src=//cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.min.js></script>\n<script src=/relay/relay.min.js></script>\n<div id=content />\n<!-- now request our browserified bundle which will run the React.render -->\n<script src=/bundle.js></script>\n"
  },
  {
    "path": "schema/database.js",
    "content": "// We use these types to hold data and resolve from GraphQL types in our schema\n\nfunction User(id, name) {\n  this.id = id.toString()\n  this.name = name\n}\n\nfunction Widget(id, userId, name) {\n  this.id = id.toString()\n  this.userId = userId.toString()\n  this.name = name\n}\n\n// In a realistic system, the get functions below would return objects from a\n// datastore like a DB or a REST API instead of an in-memory store like this.\n// You can also return promises for async fetching\n\nvar users = [new User(1, 'Anonymous')]\n\nvar widgets = [\n  new Widget(1, 1, 'What\\'s-it'),\n  new Widget(2, 1, 'Who\\'s-it'),\n  new Widget(3, 1, 'How\\'s-it'),\n]\n\nmodule.exports = {\n  User: User,\n  Widget: Widget,\n  getUser: function(id) { return users.filter(function(u) { return u.id == id })[0] },\n  getAnonymousUser: function() { return users[0] },\n  getWidget: function(id) { return widgets.filter(function(w) { return w.id == id })[0] },\n  getWidgetsByUser: function(userId) { return widgets.filter(function(w) { return w.userId == userId }) },\n}\n\n"
  },
  {
    "path": "schema/schema.js",
    "content": "var GraphQL = require('graphql')\nvar GraphQLRelay = require('graphql-relay')\nvar db = require('./database')\n\n// This module exports a GraphQL Schema, which is a declaration of all the\n// types, queries and mutations we'll use in our system.\n\n// Relay adds some specific types that it needs to function, including Node, Edge, Connection\n\n// Firstly we need to create the Node interface in our system. This has nothing\n// to do with Node.js! In Relay, Node refers to an entity – that is, an object\n// with an ID.\n\n// To create this interface, we need to pass in a resolving function as the\n// first arg to nodeDefinitions that can fetch an entity given a global Relay\n// ID. The second arg can be used to resolve an entity into a GraphQL type –\n// but it's actually optional, so we'll leave it out and use isTypeOf on the\n// GraphQL types further below.\n\nvar nodeDefinitions = GraphQLRelay.nodeDefinitions(function(globalId) {\n  var idInfo = GraphQLRelay.fromGlobalId(globalId)\n  if (idInfo.type == 'User') {\n    return db.getUser(idInfo.id)\n  } else if (idInfo.type == 'Widget') {\n    return db.getWidget(idInfo.id)\n  }\n  return null\n})\n\n// We can now use the Node interface in the GraphQL types of our schema\n\nvar widgetType = new GraphQL.GraphQLObjectType({\n  name: 'Widget',\n  description: 'A shiny widget',\n\n  // Relay will use this function to determine if an object in your system is\n  // of a particular GraphQL type\n  isTypeOf: function(obj) { return obj instanceof db.Widget },\n\n  // We can either declare our fields as an object of name-to-definition\n  // mappings or a closure that returns said object (see userType below)\n  fields: {\n    id: GraphQLRelay.globalIdField('Widget'),\n    name: {\n      type: GraphQL.GraphQLString,\n      description: 'The name of the widget',\n    },\n  },\n  // This declares this GraphQL type as a Node\n  interfaces: [nodeDefinitions.nodeInterface],\n})\n\nvar userType = new GraphQL.GraphQLObjectType({\n  name: 'User',\n  description: 'A person who uses our app',\n  isTypeOf: function(obj) { return obj instanceof db.User },\n\n  // We use a closure here because we need to refer to widgetType from above\n  fields: function() {\n    return {\n      id: GraphQLRelay.globalIdField('User'),\n      name: {\n        type: GraphQL.GraphQLString,\n        description: 'The name of the user',\n      },\n      // Here we set up a paged one-to-many relationship (\"Connection\")\n      widgets: {\n        description: 'A user\\'s collection of widgets',\n\n        // Relay gives us helper functions to define the Connection and its args\n        type: GraphQLRelay.connectionDefinitions({name: 'Widget', nodeType: widgetType}).connectionType,\n        args: GraphQLRelay.connectionArgs,\n\n        // You can define a resolving function for any field.\n        // It can also return a promise if you need async data fetching\n        resolve: function(user, args) {\n          // This wraps a Connection object around your data array\n          // Use connectionFromPromisedArray if you return a promise instead\n          return GraphQLRelay.connectionFromArray(db.getWidgetsByUser(user.id), args)\n        },\n      },\n    }\n  },\n  interfaces: [nodeDefinitions.nodeInterface],\n})\n\n// Now we can bundle our types up and export a schema\n// GraphQL expects a set of top-level queries and optional mutations (we have\n// none in this simple example so we leave the mutation field out)\nmodule.exports = new GraphQL.GraphQLSchema({\n  query: new GraphQL.GraphQLObjectType({\n    name: 'Query',\n    fields: {\n      // Relay needs this to query Nodes using global IDs\n      node: nodeDefinitions.nodeField,\n      // Our own root query field(s) go here\n      user: {\n        type: userType,\n        resolve: function() { return db.getAnonymousUser() },\n      },\n    },\n  }),\n})\n"
  },
  {
    "path": "server.js",
    "content": "var express = require('express')\nvar graphqlHttp = require('express-graphql')\nvar schema = require('./schema/schema')\n\n// The server is just a simple Express app\nvar app = express()\n\n// We respond to all GraphQL requests from `/graphql` using the\n// `express-graphql` middleware, which we pass our schema to.\napp.use('/graphql', graphqlHttp({schema: schema}))\n\n// The rest of the routes are just for serving static files\napp.use('/relay', express.static('./node_modules/react-relay/dist'))\napp.use('/', express.static('./public'))\n\napp.listen(3000, function() { console.log('Listening on 3000...') }) // eslint-disable-line no-console\n"
  },
  {
    "path": "utils/babelRelayPlugin.js",
    "content": "module.exports = require('babel-relay-plugin')(require('../schema/schema.json').data)\n"
  },
  {
    "path": "utils/updateSchema.js",
    "content": "var fs = require('fs')\nvar path = require('path')\nvar graphql = require('graphql').graphql\nvar introspectionQuery = require('graphql/utilities').introspectionQuery\nvar schema = require('../schema/schema')\n\ngraphql(schema, introspectionQuery).then(function(result) {\n  if (result.errors) return console.error(result.errors) // eslint-disable-line no-console\n  fs.writeFileSync(path.join(__dirname, '../schema/schema.json'), JSON.stringify(result, null, 2))\n})\n"
  }
]