UNPKG

sql-to-graphql

Version:

Generate a GraphQL API based on your SQL database structure

14 lines (10 loc) 218 B
import knex from 'knex'; import config from './config/config'; var db; export default function getDb() { return db || getDb.reconnect(); } getDb.reconnect = function() { db = knex(config); return db; };