legendaryjs
Version:
LegendaryJS – The ultimate backend framework for speed, power, and simplicity.
25 lines (19 loc) • 493 B
JavaScript
const { graphqlHTTP } = require('express-graphql');
const { buildSchema } = require('graphql');
function initGraphQL(app) {
const schema = buildSchema(`
type Query {
hello: String
}
`);
const root = {
hello: () => 'Hello from Legendary GraphQL!'
};
app.use('/graphql', graphqlHTTP({
schema,
rootValue: root,
graphiql: true
}));
console.log('🧬 GraphQL endpoint ready at /graphql');
}
module.exports = { initGraphQL };