0.0.7 • Published 3 years ago

@phartenfeller/tuql v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@phartenfeller/tuql

Fork of tuql without CLI but usable as a library.

Example implementation:

import initGraphQLServer from '@phartenfeller/tuql';
import express from 'express';
import cors from 'cors';
import graphqlHTTP from 'express-graphql';

async function main() {
  const app = express();

  const schema = await initGraphQLServer({
    filePath: './testUtils/chinook.db',
    mutations: false
  });

  app.use(
    '/graphql',
    cors(),
    graphqlHTTP({
      schema,
      graphiql: true,
    })
  );

  app.listen(4000, () =>
    console.log(` > Running at http://localhost:${4000}/graphql`)
  );
}

main();