import { createYoga, createSchema } from 'graphql-yoga';
import { createServer } from 'node:http';
import { typeDefs } from './schema.js';
import { resolvers } from './resolvers.js';

const schema = createSchema({
    typeDefs,
    resolvers,
});

const yoga = createYoga({ schema });
const server = createServer(yoga);

server.listen(3001, () => {
    console.log('Server is running on http://localhost:3001/graphql');
});
