Skip to content

Instantly share code, notes, and snippets.

@ivanbtrujillo
Last active June 18, 2017 16:33
Show Gist options
  • Save ivanbtrujillo/9c52af0c35c6bd92a278a78e5b4f275c to your computer and use it in GitHub Desktop.
Save ivanbtrujillo/9c52af0c35c6bd92a278a78e5b4f275c to your computer and use it in GitHub Desktop.
GraphQL. 03 — Schemas y GraphiQL - 06
const express = require('express'),
expressGraphQL = require('express-graphql'),
// Importamos el schema
schema = require('./schema/schema');
const app = express();
app.use('/graphql', expressGraphQL({
// Lo pasamos como parámetro
schema,
graphiql: true
}));
app.listen(4000, (err, res) => {
if (err)
console.log(`Error: ${err}`);
else
console.log('Servidor express funcionando en el puerto 4000')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment