graphqldoc
Version:
Generate GraphQL docs from schema.
24 lines (23 loc) • 699 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const graphql_1 = require("graphql");
const pack = require('../package.json');
exports.EmptySchema = new graphql_1.GraphQLSchema({
query: new graphql_1.GraphQLObjectType({
name: 'Query',
description: 'Root query',
fields: {
version: {
type: new graphql_1.GraphQLNonNull(graphql_1.GraphQLString),
resolve: () => pack.version
}
}
})
});
const app = require('express')();
const graphqlHTTP = require('express-graphql');
app.use('/graphql', graphqlHTTP({
schema: exports.EmptySchema,
graphiql: true
}));
app.listen(4000);